Use weak shell quoting for npm tasks with --

Part of #115876
This commit is contained in:
Alex Ross 2021-02-05 16:22:17 +01:00
parent 3c7fc6d6a0
commit a4a6607ceb

View file

@ -324,7 +324,7 @@ export async function createTask(packageManager: string, script: NpmTaskDefiniti
const result: (string | ShellQuotedString)[] = new Array(cmd.length);
for (let i = 0; i < cmd.length; i++) {
if (/\s/.test(cmd[i])) {
result[i] = { value: `${cmd[i]}`, quoting: ShellQuoting.Strong };
result[i] = { value: cmd[i], quoting: cmd[i].includes('--') ? ShellQuoting.Weak : ShellQuoting.Strong };
} else {
result[i] = cmd[i];
}