Skip to content

Commit

Permalink
Use weak shell quoting for npm tasks with --
Browse files Browse the repository at this point in the history
Part of #115876
  • Loading branch information
alexr00 committed Feb 5, 2021
1 parent 3c7fc6d commit a4a6607
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extensions/npm/src/tasks.ts
Expand Up @@ -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];
}
Expand Down

0 comments on commit a4a6607

Please sign in to comment.