cp over CMakeLists.txt if cmake builds fail

The self help text does not mention the log, but we can add this later, and for now at least the file is salvaged.

Closes Homebrew/homebrew#5940.
This commit is contained in:
Max Howell 2011-08-31 17:35:33 +01:00
parent a32e738f7c
commit b309396b02

View File

@ -259,11 +259,14 @@ class Formula
yield self yield self
rescue Interrupt, RuntimeError, SystemCallError => e rescue Interrupt, RuntimeError, SystemCallError => e
unless ARGV.debug? unless ARGV.debug?
if File.exist? 'config.log'
logs = File.expand_path '~/Library/Logs/Homebrew/' logs = File.expand_path '~/Library/Logs/Homebrew/'
if File.exist? 'config.log'
mkdir_p logs mkdir_p logs
cp 'config.log', logs mv 'config.log', logs
end end
if File.exist? 'CMakeLists.txt'
mkdir_p logs
mv 'CMakeLists.txt', logs
raise raise
end end
onoe e.inspect onoe e.inspect