Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(installed): Fix 'core/installed' that mark failed app as 'installed' #4650

Merged
merged 2 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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