aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2012-03-07 18:44:05 -0800
committerAdam Vandenberg2012-03-09 18:48:23 -0800
commit1bb780d014b09b0d7d0463c946a0001c8538be35 (patch)
treedae5a8bbfc1bd223717f882db8ebc9be81707ca8
parent675b30b8dbf332cf081cf277f5756a3b12affa0e (diff)
downloadhomebrew-1bb780d014b09b0d7d0463c946a0001c8538be35.tar.bz2
Tell the user when build logs are copied
-rw-r--r--Library/Homebrew/formula.rb11
-rw-r--r--Library/Homebrew/global.rb3
2 files changed, 6 insertions, 8 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 742b5e53a..eb3cd7b2e 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -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
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index b1e722b8b..c53160fe7 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -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