12345678910111213141516171819202122232425262728 |
- #!/usr/bin/env pwsh
- $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
- $exe=""
- if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
-
-
- $exe=".exe"
- }
- $ret=0
- if (Test-Path "$basedir/node$exe") {
-
- if ($MyInvocation.ExpectingInput) {
- $input | & "$basedir/node$exe" "$basedir/../which/bin/which" $args
- } else {
- & "$basedir/node$exe" "$basedir/../which/bin/which" $args
- }
- $ret=$LASTEXITCODE
- } else {
-
- if ($MyInvocation.ExpectingInput) {
- $input | & "node$exe" "$basedir/../which/bin/which" $args
- } else {
- & "node$exe" "$basedir/../which/bin/which" $args
- }
- $ret=$LASTEXITCODE
- }
- exit $ret
|