1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Simplify some code

This method always receives an array, and we require `shellwords`
unconditionally at the top of the file, so `shelljoin` will always be
available.

https://github.com/rubygems/rubygems/commit/05c8ac641d
This commit is contained in:
David Rodríguez 2021-08-25 14:49:49 +02:00 committed by git
parent e97c671b3a
commit df21600b98

View file

@ -215,8 +215,7 @@ module Bundler
def sh(cmd, &block)
out, status = sh_with_status(cmd, &block)
unless status.success?
cmd = cmd.shelljoin if cmd.respond_to?(:shelljoin)
raise("Running `#{cmd}` failed with the following output:\n\n#{out}\n")
raise("Running `#{cmd.shelljoin}` failed with the following output:\n\n#{out}\n")
end
out
end