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")