diff --git a/CHANGELOG.md b/CHANGELOG.md index 27f66c4e57..89cb0b71f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - **decompress:** Exclude '*.nsis' that may cause error ([#5294](https://github.com/ScoopInstaller/Scoop/issues/5294)) - **autoupdate:** Fix file hash extraction ([#5295](https://github.com/ScoopInstaller/Scoop/issues/5295)) - **shortcuts:** Output correctly formatted path ([#5333](https://github.com/ScoopInstaller/Scoop/issues/5333)) +- **core:** Fix scripts' calling parameters ([#5365](https://github.com/ScoopInstaller/Scoop/issues/5365)) - **core:** Fix `is_in_dir` under Unix ([#5391](https://github.com/ScoopInstaller/Scoop/issues/5391)) - **env:** Avoid automatic expansion of `%%` in env ([#5395](https://github.com/ScoopInstaller/Scoop/issues/5395)) - **install:** Fix download from private GitHub repositories ([#5361](https://github.com/ScoopInstaller/Scoop/issues/5361)) diff --git a/lib/install.ps1 b/lib/install.ps1 index 384c2e38b7..22b76423ca 100644 --- a/lib/install.ps1 +++ b/lib/install.ps1 @@ -1067,13 +1067,18 @@ function ensure_none_failed($apps) { foreach ($app in $apps) { $app = ($app -split '/|\\')[-1] -replace '\.json$', '' foreach ($global in $true, $false) { + if ($global) { + $instArgs = @('--global') + } else { + $instArgs = @() + } if (failed $app $global) { if (installed $app $global) { info "Repair previous failed installation of $app." - & "$PSScriptRoot\..\libexec\scoop-reset.ps1" $app$(if ($global) { ' --global' }) + & "$PSScriptRoot\..\libexec\scoop-reset.ps1" $app @instArgs } else { warn "Purging previous failed installation of $app." - & "$PSScriptRoot\..\libexec\scoop-uninstall.ps1" $app$(if ($global) { ' --global' }) + & "$PSScriptRoot\..\libexec\scoop-uninstall.ps1" $app @instArgs } } } diff --git a/libexec/scoop-import.ps1 b/libexec/scoop-import.ps1 index 1221e127bf..383e78578e 100644 --- a/libexec/scoop-import.ps1 +++ b/libexec/scoop-import.ps1 @@ -34,20 +34,19 @@ foreach ($item in $import.buckets) { } foreach ($item in $import.apps) { + $instArgs = @() + $holdArgs = @() $info = $item.Info -Split ', ' - $global = if ('Global install' -in $info) { - ' --global' - } else { - '' + if ('Global install' -in $info) { + $instArgs += '--global' + $holdArgs += '--global' } - $arch = if ('64bit' -in $info -and '64bit' -ne $def_arch) { - ' --arch 64bit' + if ('64bit' -in $info -and '64bit' -ne $def_arch) { + $instArgs += '--arch', '64bit' } elseif ('32bit' -in $info -and '32bit' -ne $def_arch) { - ' --arch 32bit' + $instArgs += '--arch', '32bit' } elseif ('arm64' -in $info -and 'arm64' -ne $def_arch) { - ' --arch arm64' - } else { - '' + $instArgs += '--arch', 'arm64' } $app = if ($item.Source -in $bucket_names) { @@ -58,9 +57,9 @@ foreach ($item in $import.apps) { $item.Source } - & "$PSScriptRoot\scoop-install.ps1" $app$global$arch + & "$PSScriptRoot\scoop-install.ps1" $app @instArgs if ('Held package' -in $info) { - & "$PSScriptRoot\scoop-hold.ps1" $($item.Name)$global + & "$PSScriptRoot\scoop-hold.ps1" $item.Name @holdArgs } }