Skip to content

Commit

Permalink
vscode_extension_installer: use UID for installs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Mar 28, 2024
1 parent 77f4db8 commit 5319269
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/bundle/vscode_extension_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ def install(name, preinstall: true, no_upgrade: false, verbose: false, force: fa

puts "Installing #{name} VSCode extension. It is not currently installed." if verbose

return false unless Bundle.system "code", "--install-extension", name, verbose: verbose
install_extension = proc do
Bundle.system("code", "--install-extension", name, verbose:)
end
success = if Process.euid == Process.uid
install_extension.call
else
Process::UID.switch(&install_extension)
end
return false unless success

installed_extensions << name

Expand Down

0 comments on commit 5319269

Please sign in to comment.