From f88eec14bc5e185d98bdcc052fd851291dee19e2 Mon Sep 17 00:00:00 2001 From: Sushain Cherivirala Date: Wed, 24 Feb 2021 20:14:05 -0800 Subject: [PATCH] Add ESBUILD_BIN_PATH (#881) --- lib/install.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/install.ts b/lib/install.ts index f386bd3b04c..805592e8587 100644 --- a/lib/install.ts +++ b/lib/install.ts @@ -221,7 +221,10 @@ function installDirectly(name: string) { if (process.env.ESBUILD_BIN_PATH_FOR_TESTS) { fs.unlinkSync(binPath); fs.symlinkSync(process.env.ESBUILD_BIN_PATH_FOR_TESTS, binPath); - validateBinaryVersion(process.env.ESBUILD_BIN_PATH_FOR_TESTS); + validateBinaryVersion(binPath); + } else if (process.env.ESBUILD_BIN_PATH) { + fs.copyFileSync(process.env.ESBUILD_BIN_PATH, binPath); + validateBinaryVersion(binPath); } else { installBinaryFromPackage(name, 'bin/esbuild', binPath) .catch(e => setImmediate(() => { throw e; }));