diff options
| author | Jack Nagel | 2015-02-12 19:13:03 -0500 |
|---|---|---|
| committer | Jack Nagel | 2015-02-12 19:13:03 -0500 |
| commit | 0588ec1d04b67dd42978afddbe501d97ab1fadcc (patch) | |
| tree | 742a210415ba5e037df0ba43ebb7b955169ceab0 /Library/ENV/4.3/cc | |
| parent | 059cd3180ce5bdc8ba8aa80d2fbdff510c6fd43e (diff) | |
| download | homebrew-0588ec1d04b67dd42978afddbe501d97ab1fadcc.tar.bz2 | |
Get the basename and dirname once
Diffstat (limited to 'Library/ENV/4.3/cc')
| -rwxr-xr-x | Library/ENV/4.3/cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index 5194ca377..5211dfa15 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -29,8 +29,8 @@ class Cmd attr_reader :config, :prefix, :cellar, :tmpdir, :sysroot attr_reader :archflags, :optflags - def initialize path, args - @arg0 = File.basename(path).freeze + def initialize(arg0, args) + @arg0 = arg0 @args = args.freeze @config = ENV.fetch("HOMEBREW_CCCFG") { "" } @prefix = ENV['HOMEBREW_PREFIX'] @@ -332,14 +332,16 @@ if __FILE__ == $PROGRAM_NAME ####################################################################### main - LOGGER.puts "#{File.basename($0)} called with: #{ARGV.join(" ")}" + dirname, basename = File.split($0) - cmd = Cmd.new($0, ARGV) + LOGGER.puts "#{basename} called with: #{ARGV.join(" ")}" + + cmd = Cmd.new(basename, ARGV) tool, args = cmd.tool, cmd.args LOGGER.puts "superenv executed: #{tool} #{args.join(" ")}" LOGGER.log! args << { :close_others => false } if RUBY_VERSION >= "2.0" - exec "#{File.dirname($0)}/xcrun", tool, *args + exec "#{dirname}/xcrun", tool, *args end |
