Skip to content

Commit 8e69c2d

Browse files
check bundler is present before using it
1 parent 6ff7fe1 commit 8e69c2d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/singed/cli.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,19 @@ def run
8888
prompt_password
8989
end
9090

91-
Bundler.with_unbundled_env do
91+
rbspy = lambda do
9292
# don't run things with spring, because it forks and rbspy won't see it
9393
sudo ['rbspy', *rbspy_args], reason: 'Singed needs to run as root, but will drop permissions back to your user.', env: { 'DISABLE_SPRING' => '1' }
9494
end
9595

96+
if defined?(Bundler)
97+
Bundler.with_unbundled_env do
98+
rbspy.call
99+
end
100+
else
101+
rbspy.call
102+
end
103+
96104
unless filename.exist?
97105
puts "#{filename} doesn't exist. Maybe rbspy had a failure capturing it? Check the scrollback."
98106
exit 1

0 commit comments

Comments
 (0)