Skip to content

Commit 8b1871b

Browse files
committed
fix: uninstall fails to remove architecture-specific shims (fixes #1191)
1 parent d5eaf42 commit 8b1871b

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

bin/uninstall.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function do_uninstall($app, $global) {
2424

2525
echo "uninstalling $app"
2626
run_uninstaller $manifest $architecture $dir
27-
rm_shims $manifest $global
27+
rm_shims $manifest $global $architecture
2828

2929
# If a junction was used during install, that will have been used
3030
# as the reference directory. Othewise it will just be the version

lib/install.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,10 @@ function rm_shim($name, $shimdir) {
589589
}
590590
}
591591

592-
function rm_shims($manifest, $global) {
593-
$manifest.bin | ?{ $_ -ne $null } | % {
592+
function rm_shims($manifest, $global, $arch) {
593+
$shims = @(arch_specific 'bin' $manifest $arch)
594+
595+
$shims | ?{ $_ -ne $null } | % {
594596
$target, $name, $null = shim_def $_
595597
$shimdir = shimdir $global
596598

libexec/scoop-uninstall.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ foreach($app in $apps) {
6060
$architecture = $install.architecture
6161

6262
run_uninstaller $manifest $architecture $dir
63-
rm_shims $manifest $global
63+
rm_shims $manifest $global $architecture
6464
rm_startmenu_shortcuts $manifest $global
6565

6666
# If a junction was used during install, that will have been used

libexec/scoop-update.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function update($app, $global, $quiet = $false, $independent) {
131131

132132
"uninstalling $app ($old_version)"
133133
run_uninstaller $old_manifest $architecture $dir
134-
rm_shims $old_manifest $global
134+
rm_shims $old_manifest $global $architecture
135135
env_rm_path $old_manifest $dir $global
136136
env_rm $old_manifest $global
137137
# note: keep the old dir in case it contains user files

0 commit comments

Comments
 (0)