fix(shim): Add 'Get-CommandPath()' to find git#4913
Conversation
|
This is a bad implementation. To keep the libcore to be decoupled, it should never call other modules. An abstraction of extracting |
|
Why do we need to keep core.ps1 decoupled? IIRC we stopped importing it in the installation script. Nevertheless this PR is mainly intended as a hotfix (which should go out with v2.0.0) otherwise bash shims will not work. I'll try to implement a proper way later in a subsequent PR. |
|
I prefer a two-step check for this function: one for scoop-installed git, then a gcm one. scoop installed git could be checked by |
|
Checking for scoop installed git using |
|
Hmm, so let's extract the main function of |
|
@rashil2000 Tweak some codes by using 'Get-ShimPath |
| return $null | ||
| } | ||
| $commandPath = if ($comm.Path -like "$userShims*" -or $comm.Path -like "$globalShims*") { | ||
| Get-ShimTarget ($comm.Path -replace '\.exe$', '.shim') |
There was a problem hiding this comment.
If a bin includes both *.ps1 and *.exe shims (like aria2c):
> gcm aria2c -all
...\shims\aria2c.ps1
...\shims\aria2c.exe
The command scoop which aria2c show 'aria2c' not found / not a scoop shim..
There was a problem hiding this comment.
The new shim system should use only .exe shims, and .ps1 shims are only used for .cmd or bash script.
Try remove all shims except scoop.* and scoop reset *, and this should be fixed.
Description
Without
scoop-which, the shimming function was picking up the ~\scoop\shims directory as source. This corrects it.Motivation and Context
Closes ScoopInstaller/Main#3562
How Has This Been Tested?
Checklist: