From 4b451ae60a725a9723899509bd7100edd0b10d13 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 9 Apr 2024 09:34:29 +0100 Subject: [PATCH] bundle/commands/cleanup: exchange UID if needed on VSCode uninstall. Otherwise, these may be uninstalled from the wrong user. --- lib/bundle/commands/cleanup.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/bundle/commands/cleanup.rb b/lib/bundle/commands/cleanup.rb index 2f2974247..1936ebd78 100644 --- a/lib/bundle/commands/cleanup.rb +++ b/lib/bundle/commands/cleanup.rb @@ -37,8 +37,10 @@ def run(global: false, file: nil, force: false, zap: false) Kernel.system HOMEBREW_BREW_FILE, "untap", *taps if taps.any? - vscode_extensions.each do |extension| - Kernel.system "code", "--uninstall-extension", extension + Bundle.exchange_uid_if_needed! do + vscode_extensions.each do |extension| + Kernel.system "code", "--uninstall-extension", extension + end end cleanup = system_output_no_stderr(HOMEBREW_BREW_FILE, "cleanup")