Skip to content

Commit ac56e35

Browse files
committed
Ensure clean build command still works on windows.
1 parent 8d94219 commit ac56e35

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/rush-lib/src/utilities/Utilities.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,19 @@ export default class Utilities {
302302
): child_process.SpawnSyncReturns<Buffer> {
303303
let shellCommand: string = process.env.comspec || 'cmd';
304304
let commandFlags: string = '/d /s /c';
305+
let useShell: boolean = true;
305306
if (process.platform !== 'win32') {
306307
shellCommand = 'sh';
307308
commandFlags = '-c';
309+
useShell = false;
308310
}
309311

310312
const result: child_process.SpawnSyncReturns<Buffer> = child_process.spawnSync(
311313
shellCommand,
312314
[commandFlags, command],
313315
{
314316
cwd: workingDirectory,
315-
shell: false,
317+
shell: useShell,
316318
env: environmentVariables,
317319
stdio: captureOutput ? ['pipe', 'pipe', 'pipe'] : [0, 1, 2]
318320
});
@@ -336,17 +338,19 @@ export default class Utilities {
336338
): child_process.ChildProcess {
337339
let shellCommand: string = process.env.comspec || 'cmd';
338340
let commandFlags: string = '/d /s /c';
341+
let useShell: boolean = true;
339342
if (process.platform !== 'win32') {
340343
shellCommand = 'sh';
341344
commandFlags = '-c';
345+
useShell = false;
342346
}
343347

344348
return child_process.spawn(
345349
shellCommand,
346350
[commandFlags, command],
347351
{
348352
cwd: workingDirectory,
349-
shell: false,
353+
shell: useShell,
350354
env: environmentVariables,
351355
stdio: captureOutput ? ['pipe', 'pipe', 'pipe'] : [0, 1, 2]
352356
});

0 commit comments

Comments
 (0)