diff --git a/CHANGELOG.md b/CHANGELOG.md index 115808d137..0d5f8df8f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/lib/core.ps1 b/lib/core.ps1 index ff9de6e648..fab07aa952 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -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