Skip to content

Commit 952a5f7

Browse files
authored
Fix spawn calls to use Windows path quoting (#17020)
1 parent aa818ba commit 952a5f7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/platform/common/process/proc.node.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
import { logProcess } from './logger.node';
2323
import { noop } from '../utils/misc';
2424
import { dispose } from '../utils/lifecycle';
25+
import { fileToCommandArgument } from '../helpers';
2526

2627
export class BufferDecoder implements IBufferDecoder {
2728
public decode(buffers: Buffer[]): string {
@@ -80,7 +81,7 @@ export class ProcessService implements IProcessService {
8081

8182
public execObservable(file: string, args: string[], options: SpawnOptions = {}): ObservableExecutionResult<string> {
8283
const spawnOptions = this.getDefaultOptions(options);
83-
const proc = spawn(file, args, spawnOptions);
84+
const proc = spawn(fileToCommandArgument(file), args, spawnOptions);
8485
let procExited = false;
8586
logger.ci(`Exec observable ${file}, ${args.join(' ')}`);
8687
const disposables: IDisposable[] = [];
@@ -155,7 +156,7 @@ export class ProcessService implements IProcessService {
155156
}
156157
public exec(file: string, args: string[], options: SpawnOptions = {}): Promise<ExecutionResult<string>> {
157158
const spawnOptions = this.getDefaultOptions(options);
158-
const proc = spawn(file, args, spawnOptions);
159+
const proc = spawn(fileToCommandArgument(file), args, spawnOptions);
159160
const deferred = createDeferred<ExecutionResult<string>>();
160161
const disposable: IDisposable = {
161162
dispose: () => {

0 commit comments

Comments
 (0)