Skip to content

Commit

Permalink
fix(core): Fix detection of Git (#5545)
Browse files Browse the repository at this point in the history
* fix(core): Fix `Test-GitAvailable`

* fix(core): Fallback git(32bit) to `Get-HelperPath`

* check value of `$internalgit` also

* changlog

* path already tested when invoke `Get-AppFilePAth`
  • Loading branch information
HUMORCE committed Oct 5, 2023
1 parent b3c05e7 commit 863af42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- **shim:** Use bash executable directly ([#5433](https://github.com/ScoopInstaller/Scoop/issues/5433))
- **core:** Avoid error messages when deleting non-existent environment variable ([#5547](https://github.com/ScoopInstaller/Scoop/issues/5547))
- **core:** Use relative path as fallback of `$scoopdir` ([#5544](https://github.com/ScoopInstaller/Scoop/issues/5544))
- **core:** Fix detection of Git ([#5545](https://github.com/ScoopInstaller/Scoop/issues/5545))
- **scoop-checkup:** Skip defender check in Windows Sandbox ([#5519](https://github.com/ScoopInstaller/Scoop/issues/5519))
- **buckets:** Avoid error messages for unexpected dir ([#5549](https://github.com/ScoopInstaller/Scoop/issues/5549))
- **scoop-virustotal:** Fix `scoop-virustotal` when `--all` has been passed without app ([#5593](https://github.com/ScoopInstaller/Scoop/pull/5593))
Expand Down
6 changes: 3 additions & 3 deletions lib/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ Function Test-CommandAvailable {
}

Function Test-GitAvailable {
Return [Boolean](Test-Path (Get-HelperPath -Helper Git) -ErrorAction Ignore)
return [Boolean](Get-HelperPath -Helper Git)
}

function Get-HelperPath {
Expand All @@ -420,8 +420,8 @@ function Get-HelperPath {
process {
switch ($Helper) {
'Git' {
$internalgit = "$(versiondir 'git' 'current')\mingw64\bin\git.exe"
if (Test-Path $internalgit) {
$internalgit = (Get-AppFilePath 'git' 'mingw64\bin\git.exe'), (Get-AppFilePath 'git' 'mingw32\bin\git.exe') | Where-Object { $_ -ne $null }
if ($internalgit) {
$HelperPath = $internalgit
} else {
$HelperPath = (Get-Command git -ErrorAction Ignore).Source
Expand Down

0 comments on commit 863af42

Please sign in to comment.