diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 9e4dbc57bb..ddd38f3d79 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -69,7 +69,8 @@ class AbstractDownloadStrategy def safe_system(*args) if @shutup - quiet_system(*args) || raise(ErrorDuringExecution.new(args, status: $CHILD_STATUS)) + return if quiet_system(*args) + raise(ErrorDuringExecution.new(args, status: $CHILD_STATUS)) else super(*args) end diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index bea9b75aa7..6e04ea27b8 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -302,7 +302,8 @@ end # Kernel.system but with exceptions def safe_system(cmd, *args, **options) - Homebrew.system(cmd, *args, **options) || raise(ErrorDuringExecution.new([cmd, *args], status: $CHILD_STATUS)) + return if Homebrew.system(cmd, *args, **options) + raise(ErrorDuringExecution.new([cmd, *args], status: $CHILD_STATUS)) end # prints no output