Skip to content

Commit

Permalink
fix(install): Fix parsing error when installing multiple apps w/ spec…
Browse files Browse the repository at this point in the history
…ific version (#6039)

Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
  • Loading branch information
qiuyk and niheaven authored Jul 9, 2024
1 parent 7cc4fae commit a76884a
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 @@ -5,6 +5,7 @@
- **sqlite:** Fix compatibility with Windows PowerShell ([#6045](https://github.com/ScoopInstaller/Scoop/issues/6045))
- **install:** Expand `env_set` items before setting Environment Variables ([#6050](https://github.com/ScoopInstaller/Scoop/issues/6050))
- **bucket:** Implement error handling for failed bucket addition ([#6051](https://github.com/ScoopInstaller/Scoop/issues/6051))
- **install:** Fix parsing error when installing multiple apps w/ specific version ([#6039](https://github.com/ScoopInstaller/Scoop/pull/6039))

## [v0.5.0](https://github.com/ScoopInstaller/Scoop/compare/v0.4.2...v0.5.0) - 2024-07-01

Expand Down
6 changes: 3 additions & 3 deletions libexec/scoop-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ $specific_versions = $apps | Where-Object {
}

# compare object does not like nulls
if ($specific_versions.length -gt 0) {
if ($specific_versions.Count -gt 0) {
$difference = Compare-Object -ReferenceObject $apps -DifferenceObject $specific_versions -PassThru
} else {
$difference = $apps
Expand All @@ -100,13 +100,13 @@ if ($specific_versions.length -gt 0) {
$specific_versions_paths = $specific_versions | ForEach-Object {
$app, $bucket, $version = parse_app $_
if (installed_manifest $app $version) {
warn "'$app' ($version) is already installed.`nUse 'scoop update $app$(if ($global) { " --global" })' to install a new version."
warn "'$app' ($version) is already installed.`nUse 'scoop update $app$(if ($global) { ' --global' })' to install a new version."
continue
}

generate_user_manifest $app $bucket $version
}
$apps = @(($specific_versions_paths + $difference) | Where-Object { $_ } | Sort-Object -Unique)
$apps = @((@($specific_versions_paths) + $difference) | Where-Object { $_ } | Select-Object -Unique)

# remember which were explictly requested so that we can
# differentiate after dependencies are added
Expand Down

0 comments on commit a76884a

Please # to comment.