From b64273f2ed39e6a82b658cf3e635c37f14a1b9e2 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sun, 21 Jan 2024 02:14:36 +0800 Subject: [PATCH] chore: copy symlink --- scripts/postinstall.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/postinstall.js b/scripts/postinstall.js index 028fb8364..4d3d798fd 100755 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -169,12 +169,20 @@ async function main() { }); // Link the binaries in postinstall to support yarn - // const absPath = path.join(process.env.INIT_CWD, "node_modules", "supabase", binPath) - console.error(binPath, process.platform) await binLinks({ path: path.resolve("."), pkg: { ...pkg, bin: { [pkg.name]: binPath } }, }); + if (platform == "windows") { + const src = path.join( + process.env.INIT_CWD, + "node_modules", + ".bin", + "supabase" + ); + const dst = pkg.bin[pkg.name]; + await fs.promises.cp(src, dst); + } console.info("Installed Supabase CLI successfully"); }