neatorobito / scoop-crystal

Scoop bucket for the Crystal programming language on Windows
Apache License 2.0
30 stars 4 forks source link

Scoop install fails - script seems to check in wrong directory for executable. #34

Closed burque505 closed 2 weeks ago

burque505 commented 1 month ago

I've been updating via scoop for many months. Now it won't install correctly. Output:

Get-Command : The term 'crystal.exe' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\usuario\scoop\apps\scoop\current\lib\install.ps1:757 char:21
+             $bin = (Get-Command $target).Source
+                     ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (crystal.exe:String) [Get-Command], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand

Can't shim 'crystal.exe': File doesn't exist.

It does in fact exist (at least until I do 'scoop uninstall crystal'):

C:\Users\usuario\scoop\apps\crystal\1.13.1\crystal-release\crystal.exe

I haven't delved into the source code, but I believe the script is still looking for the executable in

C:\Users\usuario\scoop\apps\crystal\1.13.1\

I would prefer to keep using scoop to update, and hope this can be fixed.

burque505 commented 4 weeks ago

The issue above should not have been closed, i.e. https://github.com/crystal-lang/crystal/issues/14812. If an unsuspecting user (yours truly, for example) tries 'scoop update crystal', the installation appears not to be retrievable. Once that's done, the shim is in the wrong location, and updating with --skip-hash-check is not longer possible.

burque505 commented 2 weeks ago

Fixed in 1.13.2. Thanks.