Skip to content

Commit 7f5dd44

Browse files
npm-cli-botrichardlau
authored andcommittedMay 16, 2024
deps: upgrade npm to 10.7.0
PR-URL: #52767 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 78f84eb commit 7f5dd44

File tree

418 files changed

+9123
-16420
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

418 files changed

+9123
-16420
lines changed
 

‎deps/npm/bin/npm.ps1

+18-21
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
11
#!/usr/bin/env pwsh
2-
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
32

4-
$exe=""
5-
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6-
# Fix case when both the Windows and Linux builds of Node
7-
# are installed in the same directory
8-
$exe=".exe"
3+
$NODE_EXE="$PSScriptRoot/node.exe"
4+
if (-not (Test-Path $NODE_EXE)) {
5+
$NODE_EXE="$PSScriptRoot/node"
96
}
10-
$ret=0
11-
12-
$nodeexe = "node$exe"
13-
$nodebin = $(Get-Command $nodeexe -ErrorAction SilentlyContinue -ErrorVariable F).Source
14-
if ($nodebin -eq $null) {
15-
Write-Host "$nodeexe not found."
16-
exit 1
7+
if (-not (Test-Path $NODE_EXE)) {
8+
$NODE_EXE="node"
179
}
18-
$nodedir = $(New-Object -ComObject Scripting.FileSystemObject).GetFile("$nodebin").ParentFolder.Path
1910

20-
$npmprefixjs="$nodedir/node_modules/npm/bin/npm-prefix.js"
21-
$npmprefix=(& $nodeexe $npmprefixjs)
11+
$NPM_PREFIX_JS="$PSScriptRoot/node_modules/npm/bin/npm-prefix.js"
12+
$NPM_CLI_JS="$PSScriptRoot/node_modules/npm/bin/npm-cli.js"
13+
$NPM_PREFIX=(& $NODE_EXE $NPM_PREFIX_JS)
14+
2215
if ($LASTEXITCODE -ne 0) {
2316
Write-Host "Could not determine Node.js install directory"
2417
exit 1
2518
}
26-
$npmprefixclijs="$npmprefix/node_modules/npm/bin/npm-cli.js"
19+
20+
$NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npm-cli.js"
21+
if (Test-Path $NPM_PREFIX_NPM_CLI_JS) {
22+
$NPM_CLI_JS=$NPM_PREFIX_NPM_CLI_JS
23+
}
2724

2825
# Support pipeline input
2926
if ($MyInvocation.ExpectingInput) {
30-
$input | & $nodeexe $npmprefixclijs $args
27+
$input | & $NODE_EXE $NPM_CLI_JS $args
3128
} else {
32-
& $nodeexe $npmprefixclijs $args
29+
& $NODE_EXE $NPM_CLI_JS $args
3330
}
34-
$ret=$LASTEXITCODE
35-
exit $ret
31+
32+
exit $LASTEXITCODE

‎deps/npm/bin/npx-cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const removed = new Set([
2626

2727
const { definitions, shorthands } = require('@npmcli/config/lib/definitions')
2828
const npmSwitches = Object.entries(definitions)
29-
.filter(([key, { type }]) => type === Boolean ||
29+
.filter(([, { type }]) => type === Boolean ||
3030
(Array.isArray(type) && type.includes(Boolean)))
3131
.map(([key]) => key)
3232

0 commit comments

Comments
 (0)
Please sign in to comment.