diff --git a/script/codesign/generate-identity.sh b/script/codesign/generate-identity.sh index 27161ce24392..8ed6e3339971 100755 --- a/script/codesign/generate-identity.sh +++ b/script/codesign/generate-identity.sh @@ -40,7 +40,7 @@ DevToolsSecurity -enable # security import "$dir"/public.key -k $KEY_CHAIN # Generate Trust Settings -npx ts-node "$(dirname $0)"/gen-trust.ts "$dir"/certificate.cer "$dir"/trust.xml +npm_config_yes=true npx ts-node "$(dirname $0)"/gen-trust.ts "$dir"/certificate.cer "$dir"/trust.xml # Import Trust Settings sudo security trust-settings-import -d "$dir/trust.xml" diff --git a/script/lib/npx.py b/script/lib/npx.py index c4414f94aa06..dc156c0eefd4 100644 --- a/script/lib/npx.py +++ b/script/lib/npx.py @@ -1,10 +1,13 @@ +import os import subprocess import sys def npx(*npx_args): + npx_env = os.environ.copy() + npx_env['npm_config_yes'] = 'true' call_args = [__get_executable_name()] + list(npx_args) - subprocess.check_call(call_args) + subprocess.check_call(call_args, env=npx_env) def __get_executable_name(): diff --git a/script/nan-spec-runner.js b/script/nan-spec-runner.js index 5e6700309951..947723e4ca7b 100644 --- a/script/nan-spec-runner.js +++ b/script/nan-spec-runner.js @@ -22,7 +22,8 @@ async function main () { const env = Object.assign({}, process.env, { npm_config_nodedir: nodeDir, npm_config_msvs_version: '2019', - npm_config_arch: process.env.NPM_CONFIG_ARCH + npm_config_arch: process.env.NPM_CONFIG_ARCH, + npm_config_yes: 'true' }); const { status: buildStatus } = cp.spawnSync(NPX_CMD, ['node-gyp', 'rebuild', '--directory', 'test', '-j', 'max'], { env, diff --git a/script/release/uploaders/upload-symbols.py b/script/release/uploaders/upload-symbols.py index a2d561b56d3e..bb1cb84102d1 100755 --- a/script/release/uploaders/upload-symbols.py +++ b/script/release/uploaders/upload-symbols.py @@ -46,9 +46,11 @@ def main(): for symbol_file in files: print("Generating Sentry src bundle for: " + symbol_file) + npx_env = os.environ.copy() + npx_env['npm_config_yes'] = 'true' subprocess.check_output([ NPX_CMD, '@sentry/cli@1.51.1', 'difutil', 'bundle-sources', - symbol_file]) + symbol_file], env=npx_env) files += glob.glob(SYMBOLS_DIR + '/*/*/*.src.zip') diff --git a/script/spec-runner.js b/script/spec-runner.js index 10c478cb6c83..ba1f4feaee00 100755 --- a/script/spec-runner.js +++ b/script/spec-runner.js @@ -222,7 +222,8 @@ async function installSpecModules (dir) { const nodeDir = path.resolve(BASE, `out/${utils.getOutDir({ shouldLog: true })}/gen/node_headers`); const env = Object.assign({}, process.env, { npm_config_nodedir: nodeDir, - npm_config_msvs_version: '2019' + npm_config_msvs_version: '2019', + npm_config_yes: 'true' }); if (fs.existsSync(path.resolve(dir, 'node_modules'))) { await fs.remove(path.resolve(dir, 'node_modules')); diff --git a/script/yarn.js b/script/yarn.js index 7217501d3f24..08ff088327b6 100644 --- a/script/yarn.js +++ b/script/yarn.js @@ -11,7 +11,11 @@ if (process.mainModule === module) { const NPX_CMD = process.platform === 'win32' ? 'npx.cmd' : 'npx'; const child = cp.spawn(NPX_CMD, [`yarn@${YARN_VERSION}`, ...process.argv.slice(2)], { - stdio: 'inherit' + stdio: 'inherit', + env: { + ...process.env, + npm_config_yes: 'true' + } }); child.on('exit', code => process.exit(code));