File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # !/usr/bin/env pwsh
2+ $basedir = Split-Path $MyInvocation.MyCommand.Definition - Parent
3+
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"
9+ }
10+ $ret = 0
11+
12+ $nodebin = $ (Get-Command " node$exe " - ErrorAction SilentlyContinue - ErrorVariable F).Source
13+ if ($nodebin -eq $null ) {
14+ Write-Host " node$exe not found."
15+ exit 1
16+ }
17+ $nodedir = $ (New-Object - ComObject Scripting.FileSystemObject).GetFile(" $nodebin " ).ParentFolder.Path
18+
19+ # Support pipeline input
20+ if ($MyInvocation.ExpectingInput ) {
21+ $input | & " node$exe " " $nodedir /node_modules/npm/bin/npm-cli.js" $args
22+ } else {
23+ & " node$exe " " $nodedir /node_modules/npm/bin/npm-cli.js" $args
24+ }
25+ $ret = $LASTEXITCODE
26+ exit $ret
Original file line number Diff line number Diff line change 1+ # !/usr/bin/env pwsh
2+ $basedir = Split-Path $MyInvocation.MyCommand.Definition - Parent
3+
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"
9+ }
10+ $ret = 0
11+
12+ $nodebin = $ (Get-Command " node$exe " - ErrorAction SilentlyContinue - ErrorVariable F).Source
13+ if ($nodebin -eq $null ) {
14+ Write-Host " node$exe not found."
15+ exit 1
16+ }
17+ $nodedir = $ (New-Object - ComObject Scripting.FileSystemObject).GetFile(" $nodebin " ).ParentFolder.Path
18+
19+ # Support pipeline input
20+ if ($MyInvocation.ExpectingInput ) {
21+ $input | & " node$exe " " $nodedir /node_modules/npm/bin/npx-cli.js" $args
22+ } else {
23+ & " node$exe " " $nodedir /node_modules/npm/bin/npx-cli.js" $args
24+ }
25+ $ret = $LASTEXITCODE
26+ exit $ret
You can’t perform that action at this time.
0 commit comments