Skip to content

Commit c1b1dd4

Browse files
committed
fix(powershell): pass args verbatim to npm
Fixes #7375
1 parent 2558283 commit c1b1dd4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bin/npm.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ if (Test-Path $NPM_PREFIX_NPM_CLI_JS) {
2424

2525
# Support pipeline input
2626
if ($MyInvocation.ExpectingInput) {
27-
$input | & $NODE_EXE $NPM_CLI_JS $args
27+
$input | & $NODE_EXE $NPM_CLI_JS -- $args
2828
} else {
29-
& $NODE_EXE $NPM_CLI_JS $args
29+
& $NODE_EXE $NPM_CLI_JS -- $args
3030
}
3131

3232
exit $LASTEXITCODE

test/bin/windows-shims.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ t.test('shim contents', t => {
5353

5454
t.test('pwsh', t => {
5555
const { diff, letters } = diffFiles(SHIMS['npm.ps1'], SHIMS['npx.ps1'])
56-
t.strictSame(diff, [])
56+
t.strictSame(diff, ['-- ', '-- '], 'only npm powershell uses -- for verbatim args')
5757
t.strictSame([...letters], ['M', 'X'], 'all other changes are m->x')
5858
t.end()
5959
})

0 commit comments

Comments
 (0)