From 4f2f641fbd12be71af0b517073dfdb64f0caaaa2 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sun, 11 Aug 2024 08:33:05 -0700 Subject: [PATCH] Copy right dll/exe based on npm_config_arch Part of microsoft/vscode#224488 Part of microsoft/vscode#225355 --- scripts/post-install.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/post-install.js b/scripts/post-install.js index 3bf4066..0c77991 100644 --- a/scripts/post-install.js +++ b/scripts/post-install.js @@ -50,7 +50,15 @@ console.log(`\x1b[32m> Moving conpty.dll...\x1b[0m`); if (os.platform() !== 'win32') { console.log(' SKIPPED (not Windows)'); } else { - const windowsArch = os.arch(); + let windowsArch; + if (process.env.npm_config_arch) { + windowsArch = process.env.npm_config_arch; + console.log(` Using $npm_config_arch: ${windowsArch}`); + } else { + windowsArch = os.arch(); + console.log(` Using os.arch(): ${windowsArch}`); + } + if (!CONPTY_SUPPORTED_ARCH.includes(windowsArch)) { console.log(` SKIPPED (unsupported architecture ${windowsArch})`); } else {