Use guard clause instead of ||.
This commit is contained in:
parent
fec884d8da
commit
ad7be58655
@ -69,7 +69,8 @@ class AbstractDownloadStrategy
|
|||||||
|
|
||||||
def safe_system(*args)
|
def safe_system(*args)
|
||||||
if @shutup
|
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
|
else
|
||||||
super(*args)
|
super(*args)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -302,7 +302,8 @@ end
|
|||||||
|
|
||||||
# Kernel.system but with exceptions
|
# Kernel.system but with exceptions
|
||||||
def safe_system(cmd, *args, **options)
|
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
|
end
|
||||||
|
|
||||||
# prints no output
|
# prints no output
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user