superenv/cc: keep exec monkeypatch out of Object
This commit is contained in:
parent
4adf0b0f69
commit
df1d27b037
@ -21,7 +21,9 @@ def syspath
|
|||||||
%W{/usr /usr/local}
|
%W{/usr /usr/local}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def exec *args
|
|
||||||
|
module ExecLogExtension
|
||||||
|
def exec *args
|
||||||
path = File.expand_path('~/Library/Logs/Homebrew/cc.log')
|
path = File.expand_path('~/Library/Logs/Homebrew/cc.log')
|
||||||
open(path, 'a') do |f|
|
open(path, 'a') do |f|
|
||||||
f.print '[', $0
|
f.print '[', $0
|
||||||
@ -31,8 +33,8 @@ def exec *args
|
|||||||
f.puts
|
f.puts
|
||||||
end
|
end
|
||||||
Kernel.exec *args
|
Kernel.exec *args
|
||||||
end if ENV['HOMEBREW_LOG']
|
end
|
||||||
|
end
|
||||||
|
|
||||||
class Cmd
|
class Cmd
|
||||||
def initialize path, args
|
def initialize path, args
|
||||||
@ -206,6 +208,7 @@ if __FILE__ == $PROGRAM_NAME
|
|||||||
end
|
end
|
||||||
|
|
||||||
####################################################################### main
|
####################################################################### main
|
||||||
|
extend(ExecLogExtension) if ENV['HOMEBREW_LOG']
|
||||||
cmd = Cmd.new($0, ARGV)
|
cmd = Cmd.new($0, ARGV)
|
||||||
exec "xcrun", cmd.tool, *cmd.args
|
exec "xcrun", cmd.tool, *cmd.args
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user