зеркало из https://github.com/electron/electron.git
build: update npx.py to support npx@7 (#26662)
* build: update npx.py to support npx@7 * build: set npm_config_yes for all npx callsites
This commit is contained in:
Родитель
e455a79218
Коммит
b894151745
|
@ -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"
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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')
|
||||
|
||||
|
|
|
@ -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'));
|
||||
|
|
|
@ -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));
|
||||
|
|
Загрузка…
Ссылка в новой задаче