-
Couldn't load subscription status.
- Fork 43
Open
Description
What / Why
I'm working on a generic binary version manager. Everything works decently well, but I recently ran into trouble with how this package generates powershell shims expecting node.exe on the path for Windows (in my case, only node.cmd and node.ps1 exist on the path).
The cmd shim seems fine and it will fallback to using node instead of node.exe when node.exe doesn't exist (you may categorize this difference between cmd and powershell as a bug).
Current Behavior
Example of yarn's script:
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/node_modules/yarn/bin/yarn.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/node_modules/yarn/bin/yarn.js" $args
$ret=$LASTEXITCODE
}
exit $retExpected Behavior
It would do Test-Path for .exe and if that doesn't exist, then it would fallback to not providing a .exe file extension.
Thanks!
viceice
Metadata
Metadata
Assignees
Labels
No labels