Skip to content

Commit a20bb4f

Browse files
authored
fix(shim): Use bash executable directly (#5433)
* fix(shim): Use bash executable directly * Update CHANGELOG.md
1 parent ad0f617 commit a20bb4f

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- **env:** Avoid automatic expansion of `%%` in env ([#5395](https://github.com/ScoopInstaller/Scoop/issues/5395))
2020
- **install:** Fix download from private GitHub repositories ([#5361](https://github.com/ScoopInstaller/Scoop/issues/5361))
2121
- **scoop-info:** Fix errors in file size collection when `--verbose` ([#5352](https://github.com/ScoopInstaller/Scoop/pull/5352))
22+
- **shim:** Use bash executable directly ([#5433](https://github.com/ScoopInstaller/Scoop/issues/5433))
2223

2324
### Performance Improvements
2425

lib/core.ps1

+1-11
Original file line numberDiff line numberDiff line change
@@ -905,19 +905,9 @@ function shim($path, $global, $name, $arg) {
905905
) -join "`n" | Out-UTF8File $shim -NoNewLine
906906
} else {
907907
warn_on_overwrite "$shim.cmd" $path
908-
# find path to Git's bash so that batch scripts can run bash scripts
909-
if (!(Get-CommandPath git)) {
910-
error "Can't shim '$shim': 'git' is needed but not installed."
911-
error "Please install git ('scoop install git') and try again."
912-
exit 1
913-
}
914-
$gitdir = (Get-Item (Get-CommandPath git) -ErrorAction:Stop).Directory.Parent
915-
if ($gitdir.FullName -imatch 'mingw') {
916-
$gitdir = $gitdir.Parent
917-
}
918908
@(
919909
"@rem $resolved_path",
920-
"@`"$(Join-Path (Join-Path $gitdir.FullName 'bin') 'bash.exe')`" `"$resolved_path`" $arg %*"
910+
"@bash `"$resolved_path`" $arg %*"
921911
) -join "`r`n" | Out-UTF8File "$shim.cmd"
922912

923913
warn_on_overwrite $shim $path

0 commit comments

Comments
 (0)