Skip to content

Commit

Permalink
fix(powershell): pass args verbatim to npm
Browse files Browse the repository at this point in the history
Fixes #7375
  • Loading branch information
lukekarrys committed Apr 30, 2024
1 parent 2558283 commit c1b1dd4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/npm.ps1
Expand Up @@ -24,9 +24,9 @@ if (Test-Path $NPM_PREFIX_NPM_CLI_JS) {

# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & $NODE_EXE $NPM_CLI_JS $args
$input | & $NODE_EXE $NPM_CLI_JS -- $args
} else {
& $NODE_EXE $NPM_CLI_JS $args
& $NODE_EXE $NPM_CLI_JS -- $args
}

exit $LASTEXITCODE
2 changes: 1 addition & 1 deletion test/bin/windows-shims.js
Expand Up @@ -53,7 +53,7 @@ t.test('shim contents', t => {

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

0 comments on commit c1b1dd4

Please sign in to comment.