Formula#system: simplify xcodebuild special case
This commit is contained in:
parent
dca786176e
commit
63629ab13b
@ -552,6 +552,8 @@ class Formula
|
|||||||
# Pretty titles the command and buffers stdout/stderr
|
# Pretty titles the command and buffers stdout/stderr
|
||||||
# Throws if there's an error
|
# Throws if there's an error
|
||||||
def system cmd, *args
|
def system cmd, *args
|
||||||
|
removed_ENV_variables = {}
|
||||||
|
|
||||||
# remove "boring" arguments so that the important ones are more likely to
|
# remove "boring" arguments so that the important ones are more likely to
|
||||||
# be shown considering that we trim long ohai lines to the terminal width
|
# be shown considering that we trim long ohai lines to the terminal width
|
||||||
pretty_args = args.dup
|
pretty_args = args.dup
|
||||||
@ -561,9 +563,8 @@ class Formula
|
|||||||
end
|
end
|
||||||
ohai "#{cmd} #{pretty_args*' '}".strip
|
ohai "#{cmd} #{pretty_args*' '}".strip
|
||||||
|
|
||||||
removed_ENV_variables = case if args.empty? then cmd.split(' ').first else cmd end
|
if cmd.to_s.start_with? "xcodebuild"
|
||||||
when "xcodebuild"
|
removed_ENV_variables.update(ENV.remove_cc_etc)
|
||||||
ENV.remove_cc_etc
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@exec_count ||= 0
|
@exec_count ||= 0
|
||||||
@ -606,7 +607,7 @@ class Formula
|
|||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
rd.close if rd and not rd.closed?
|
rd.close if rd and not rd.closed?
|
||||||
ENV.update(removed_ENV_variables) if removed_ENV_variables
|
ENV.update(removed_ENV_variables)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user