From a4a6607ceb047abef8b51c7307a428997f0a1d64 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Fri, 5 Feb 2021 16:22:17 +0100 Subject: [PATCH] Use weak shell quoting for npm tasks with -- Part of #115876 --- extensions/npm/src/tasks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/npm/src/tasks.ts b/extensions/npm/src/tasks.ts index 53bd085caed..96db9e0dc39 100644 --- a/extensions/npm/src/tasks.ts +++ b/extensions/npm/src/tasks.ts @@ -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]; }