Skip to content

Commit e5ddcfe

Browse files
committed
Allow space in exec cmds
1 parent 51c2909 commit e5ddcfe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Gulpfile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function exec(cmd: string, args: string[], complete: () => void = (() => {}), er
6969
console.log(`${cmd} ${args.join(" ")}`);
7070
// TODO (weswig): Update child_process types to add windowsVerbatimArguments to the type definition
7171
const subshellFlag = isWin ? "/c" : "-c";
72-
const command = isWin ? [cmd, ...args] : [`${cmd} ${args.join(" ")}`];
72+
const command = isWin ? [cmd.indexOf(" ") >= 0 ? `"${cmd}"` : cmd, ...args] : [`${cmd} ${args.join(" ")}`];
7373
const ex = cp.spawn(isWin ? "cmd" : "/bin/sh", [subshellFlag, ...command], { stdio: "inherit", windowsVerbatimArguments: true } as any);
7474
ex.on("exit", (code) => code === 0 ? complete() : error(/*e*/ undefined, code));
7575
ex.on("error", error);

0 commit comments

Comments
 (0)