mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Use shell: true only on Windows (#224597)
This commit is contained in:
@@ -293,7 +293,13 @@ export class PackageJSONContribution implements IJSONContribution {
|
||||
// COREPACK_ENABLE_PROJECT_SPEC makes the npm view command succeed
|
||||
// even if packageManager specified a package manager other than npm.
|
||||
const env = { ...process.env, COREPACK_ENABLE_AUTO_PIN: '0', COREPACK_ENABLE_PROJECT_SPEC: '0' };
|
||||
cp.execFile(`"${npmCommandPath}"`, args, { cwd, env, shell: true }, (error, stdout) => {
|
||||
let options: cp.ExecFileOptions = { cwd, env };
|
||||
let commandPath: string = npmCommandPath;
|
||||
if (process.platform === 'win32') {
|
||||
options = { cwd, env, shell: true };
|
||||
commandPath = `"${npmCommandPath}"`;
|
||||
}
|
||||
cp.execFile(commandPath, args, options, (error, stdout) => {
|
||||
if (!error) {
|
||||
try {
|
||||
const content = JSON.parse(stdout);
|
||||
|
||||
Reference in New Issue
Block a user