Merge pull request #6332 from reitermarkus/brew-ruby-exit-status

Make `brew ruby` exit with the status of the executed command.
This commit is contained in:
Mike McQuaid 2019-07-28 10:59:32 +01:00 committed by GitHub
commit 3ea6aa4195
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,9 +23,13 @@ module Homebrew
def ruby
ruby_args.parse
safe_system ENV["HOMEBREW_RUBY_PATH"],
"-I", $LOAD_PATH.join(File::PATH_SEPARATOR),
"-rglobal", "-rdev-cmd/irb",
*ARGV
begin
safe_system ENV["HOMEBREW_RUBY_PATH"],
"-I", $LOAD_PATH.join(File::PATH_SEPARATOR),
"-rglobal", "-rdev-cmd/irb",
*ARGV
rescue ErrorDuringExecution => e
exit e.status.exitstatus
end
end
end