mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-16 02:24:10 +08:00
test: use execPath to launch child node processes
Using execPath ensures the child processes are the same node binary without depending on PATH.
This commit is contained in:
parent
f3fd1e4ed8
commit
b8e68eb28a
@ -345,7 +345,7 @@ export function globalNpm(args: string[], env?: NodeJS.ProcessEnv) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return _exec({ silent: true, env }, 'node', [require.resolve('npm'), ...args]);
|
return _exec({ silent: true, env }, process.execPath, [require.resolve('npm'), ...args]);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function npm(...args: string[]) {
|
export function npm(...args: string[]) {
|
||||||
@ -353,7 +353,7 @@ export function npm(...args: string[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function node(...args: string[]) {
|
export function node(...args: string[]) {
|
||||||
return _exec({}, 'node', args);
|
return _exec({}, process.execPath, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function git(...args: string[]) {
|
export function git(...args: string[]) {
|
||||||
|
@ -67,7 +67,7 @@ export async function prepareProjectForE2e(name: string) {
|
|||||||
// Often fails the first time so attempt twice if necessary.
|
// Often fails the first time so attempt twice if necessary.
|
||||||
const runWebdriverUpdate = () =>
|
const runWebdriverUpdate = () =>
|
||||||
exec(
|
exec(
|
||||||
'node',
|
process.execPath,
|
||||||
'node_modules/protractor/bin/webdriver-manager',
|
'node_modules/protractor/bin/webdriver-manager',
|
||||||
'update',
|
'update',
|
||||||
'--standalone',
|
'--standalone',
|
||||||
|
@ -19,10 +19,14 @@ export async function createNpmRegistry(
|
|||||||
configContent = configContent.replace(/\$\{HTTPS_PORT\}/g, String(httpsPort));
|
configContent = configContent.replace(/\$\{HTTPS_PORT\}/g, String(httpsPort));
|
||||||
await writeFile(join(registryPath, 'verdaccio.yaml'), configContent);
|
await writeFile(join(registryPath, 'verdaccio.yaml'), configContent);
|
||||||
|
|
||||||
return spawn('node', [require.resolve('verdaccio/bin/verdaccio'), '-c', './verdaccio.yaml'], {
|
return spawn(
|
||||||
cwd: registryPath,
|
process.execPath,
|
||||||
stdio: 'inherit',
|
[require.resolve('verdaccio/bin/verdaccio'), '-c', './verdaccio.yaml'],
|
||||||
});
|
{
|
||||||
|
cwd: registryPath,
|
||||||
|
stdio: 'inherit',
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Token was generated using `echo -n 'testing:s3cret' | openssl base64`.
|
// Token was generated using `echo -n 'testing:s3cret' | openssl base64`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user