From efb6172a18293c286dea3389840f4aa90bc13cce Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 28 Jul 2019 02:14:35 +0200 Subject: [PATCH] Make `brew ruby` exit with the status of the executed command. --- Library/Homebrew/dev-cmd/ruby.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/dev-cmd/ruby.rb b/Library/Homebrew/dev-cmd/ruby.rb index 93b36a7f36..3289500f7f 100644 --- a/Library/Homebrew/dev-cmd/ruby.rb +++ b/Library/Homebrew/dev-cmd/ruby.rb @@ -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