Skip to content

Commit 9352fa2

Browse files
committed
fix: use shell when spawning .bat or .cmd files
Refs nodejs/node@6627222409
1 parent 446f1c8 commit 9352fa2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

extensions/vscode-test-resolver/src/extension.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ export function activate(context: vscode.ExtensionContext) {
164164
const serverCommandPath = path.join(vscodePath, 'scripts', serverCommand);
165165

166166
outputChannel.appendLine(`Launching server: "${serverCommandPath}" ${commandArgs.join(' ')}`);
167-
168-
extHostProcess = cp.spawn(serverCommandPath, commandArgs, { env, cwd: vscodePath });
167+
const shell = (process.platform === 'win32');
168+
extHostProcess = cp.spawn(serverCommandPath, commandArgs, { env, cwd: vscodePath, shell });
169169
} else {
170170
const extensionToInstall = process.env['TESTRESOLVER_INSTALL_BUILTIN_EXTENSION'];
171171
if (extensionToInstall) {
@@ -182,8 +182,8 @@ export function activate(context: vscode.ExtensionContext) {
182182

183183
outputChannel.appendLine(`Using server build at ${serverLocation}`);
184184
outputChannel.appendLine(`Server arguments ${commandArgs.join(' ')}`);
185-
186-
extHostProcess = cp.spawn(path.join(serverLocation, 'bin', serverCommand), commandArgs, { env, cwd: serverLocation });
185+
const shell = (process.platform === 'win32');
186+
extHostProcess = cp.spawn(path.join(serverLocation, 'bin', serverCommand), commandArgs, { env, cwd: serverLocation, shell });
187187
}
188188
extHostProcess.stdout!.on('data', (data: Buffer) => processOutput(data.toString()));
189189
extHostProcess.stderr!.on('data', (data: Buffer) => processOutput(data.toString()));

0 commit comments

Comments
 (0)