Use guard clause instead of ||.
This commit is contained in:
parent
fec884d8da
commit
ad7be58655
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user