Pass the ENV hash into the BuildError constructor

This commit is contained in:
Jack Nagel 2014-09-13 19:47:30 -05:00
parent 20516ee39b
commit a607c71123
2 changed files with 3 additions and 3 deletions

View File

@ -147,9 +147,9 @@ end
class BuildError < Homebrew::InstallationError
attr_reader :command, :env
def initialize formula, cmd, args
def initialize(formula, cmd, args, env)
@command = cmd
@env = ENV.to_hash
@env = env
args = args.map{ |arg| arg.to_s.gsub " ", "\\ " }.join(" ")
super formula, "Failed executing: #{command} #{args}"
end

View File

@ -545,7 +545,7 @@ class Formula
log.puts
require 'cmd/config'
Homebrew.dump_build_config(log)
raise BuildError.new(self, cmd, args)
raise BuildError.new(self, cmd, args, ENV.to_hash)
end
ensure
log.close unless log.closed?