From 49ccb1c49878348cee769153722bafa658a242e4 Mon Sep 17 00:00:00 2001 From: kkb912002 Date: Thu, 5 Sep 2024 09:40:45 +0900 Subject: [PATCH] support --os --cpu args of new npm install --- index.js | 4 ++-- install.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 3df086b..0a1cb2f 100644 --- a/index.js +++ b/index.js @@ -26,8 +26,8 @@ if (process.env[BINARY_PATH_ENV_VAR]) { win32: ['x64', 'ia32'] }) - var platform = process.env.npm_config_platform || os.platform() - var arch = process.env.npm_config_arch || os.arch() + var platform = process.env.npm_config_os || process.env.npm_config_platform || os.platform() + var arch = process.env.npm_config_cpu || process.env.npm_config_arch || os.arch() let binaryPath = path.join( __dirname, diff --git a/install.js b/install.js index 1d39b15..e380950 100644 --- a/install.js +++ b/install.js @@ -164,8 +164,8 @@ const release = ( process.env[RELEASE_ENV_VAR] || pkg[pkg.name]['binary-release-tag'] ) -const arch = process.env.npm_config_arch || os.arch() -const platform = process.env.npm_config_platform || os.platform() +const arch = process.env.npm_config_cpu || process.env.npm_config_arch || os.arch() +const platform = process.env.npm_config_os || process.env.npm_config_platform || os.platform() const downloadsUrl = ( process.env[BINARIES_URL_ENV_VAR] || 'https://github.com/eugeneware/ffmpeg-static/releases/download'