Skip to content

Commit

Permalink
fix(installed): Fix 'core/installed' that mark failed app as 'install…
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven authored and se35710 committed Mar 8, 2022
1 parent 6159329 commit b6bb767
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- **depends:** Check if extractor is available ([#4042](https://github.com/ScoopInstaller/Scoop/issues/4042))
- **decompress:** Fix nested Zstd archive extraction ([#4608](https://github.com/ScoopInstaller/Scoop/issues/4608))
- **decompress:** Fix `Split-Path -LeafBase` in PS5 ([#4639](https://github.com/ScoopInstaller/Scoop/issues/4639))
- **installed:** Fix 'core/installed' that mark failed app as 'installed' ([#4650](https://github.com/ScoopInstaller/Scoop/issues/4650))
- **shim:** Fix PS1 shim error when in different drive in PS7 ([#4614](https://github.com/ScoopInstaller/Scoop/issues/4614))
- **shim:** Fix `sh` shim error in WSL ([#4637](https://github.com/ScoopInstaller/Scoop/issues/4637))

Expand Down
12 changes: 8 additions & 4 deletions lib/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,17 @@ function cache_path($app, $version, $url) { "$cachedir\$app#$version#$($url -rep

# apps
function sanitary_path($path) { return [regex]::replace($path, "[/\\?:*<>|]", "") }
function installed($app, $global=$null) {
if($null -eq $global) { return (installed $app $true) -or (installed $app $false) }
function installed($app, $global) {
# Dependencies of the format "bucket/dependency" install in a directory of form
# "dependency". So we need to extract the bucket from the name and only give the app
# name to is_directory
$app = $app.split("/")[-1]
return is_directory (appdir $app $global)
$app = ($app -split '/|\\')[-1]
if (get_config NO_JUNCTIONS) {
$installedVersion = Select-CurrentVersion -AppName $app -Global:$global
} else {
$installedVersion = 'current'
}
return Join-Path (versiondir $app $installedVersion $global) 'install.json' | Test-Path
}
function installed_apps($global) {
$dir = appsdir $global
Expand Down

0 comments on commit b6bb767

Please sign in to comment.