From aef580261b2452eda2ebad666f27692e94cbf7ef Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Wed, 7 Mar 2012 18:44:05 -0800 Subject: [PATCH] Tell the user when build logs are copied --- Library/Homebrew/formula.rb | 11 +++-------- Library/Homebrew/global.rb | 3 +++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 742b5e53a8..eb3cd7b2e8 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 b1e722b8b8..c53160fe77 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