Tell the user when build logs are copied

This commit is contained in:
Adam Vandenberg 2012-03-07 18:44:05 -08:00
parent 04088ba96d
commit aef580261b
2 changed files with 6 additions and 8 deletions

View File

@ -192,14 +192,9 @@ class Formula
yield self
rescue Interrupt, RuntimeError, SystemCallError => e
unless ARGV.debug?
logs = File.expand_path '~/Library/Logs/Homebrew/'
if File.exist? 'config.log'
mkdir_p logs
mv 'config.log', logs
end
if File.exist? 'CMakeCache.txt'
mkdir_p logs
mv 'CMakeCache.txt', logs
%w(config.log CMakeCache.txt).select{|f| File.exist? f}.each do |f|
HOMEBREW_LOGS.install f
ohai "#{f} was copied to #{HOMEBREW_LOGS}"
end
raise
end

View File

@ -51,6 +51,9 @@ else
HOMEBREW_REPOSITORY+"Cellar"
end
HOMEBREW_LOGS = Pathname.new('~/Library/Logs/Homebrew/').expand_path
MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp
MACOS_VERSION = /(10\.\d+)(\.\d+)?/.match(MACOS_FULL_VERSION).captures.first.to_f