App-Rakubrew
App-Rakubrew copied to clipboard
`rakubrew init` poor advice on Windows
Installing Rakubrew using . {iwr -useb https://rakubrew.org/install-on-powershell.ps1 } | iex
in Powershell, the init
advice is:
- not for Powershell
- it is not for Powershell even when explicitly running "
C:\rakubrew\bin\rakubrew.exe init
in a PowerShell window" as advised - by the way, would a Windows Terminal PS tab qualify as one? Anyway, didn't work with a plain Powershell window either. - the CMD advice is overly fragile in my opinion - it's not obvious that it wouldn't work if you copied and pasted it into a batch file and ran that... as somebody who doesn't normally use CMD and Batch, it tripped me up big time. Since it's a multiline command and it's hard-coded into Rakubrew anyway, maybe it could actually generate a bat for it at least.
The code to discern Powershell from CMD is:
# https://stackoverflow.com/a/8547234
my $psmodpath = $ENV{PSMODULEPATH};
my $userprofile = $ENV{USERPROFILE};
if (index($psmodpath, $userprofile) == 0) {
return 'PowerShell';
}
else {
return 'CMD';
}
Whoever observes this misbehavior: Can you provide the contents of the $env:PSMODULEPATH
and $env:USERPROFILE
env variables?
I found an issue in the logic that causes misidentification on x86 Powershells. Fix is upcoming. Also the logic doesn't work on PS version 1. That shouldn't be an issue though (Ps 1 is Windows XP aera).
Version 39 fixes an issue with misidentification of x86 PowerShell Windows. Unsure if the reporter observed that issue or a different one.