Skip to content

Commit 5cf34af

Browse files
authored
Use weak shell quoting for npm tasks with -- (#116309)
Fixes #115876
1 parent 6635ca9 commit 5cf34af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extensions/npm/src/tasks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ export async function createTask(context: ExtensionContext, script: NpmTaskDefin
324324
const result: (string | ShellQuotedString)[] = new Array(cmd.length);
325325
for (let i = 0; i < cmd.length; i++) {
326326
if (/\s/.test(cmd[i])) {
327-
result[i] = { value: `${cmd[i]}`, quoting: ShellQuoting.Strong };
327+
result[i] = { value: cmd[i], quoting: cmd[i].includes('--') ? ShellQuoting.Weak : ShellQuoting.Strong };
328328
} else {
329329
result[i] = cmd[i];
330330
}

0 commit comments

Comments
 (0)