Only show the troubleshooting link

This has to be a last resort right? If all we show is that link (plus preceding un-deletable output) and they don't click it then maybe we should just close the ticket and hope they'll use MacPorts instead.
This commit is contained in:
Max Howell 2012-10-31 11:26:45 -04:00
parent e502728641
commit 394549dd3d
2 changed files with 19 additions and 7 deletions

View File

@ -94,22 +94,33 @@ class BuildError < Homebrew::InstallationError
@command == './configure' @command == './configure'
end end
def issues
@issues ||= GitHub.issues_for_formula(formula.name)
end
def dump def dump
logs = "#{ENV['HOME']}/Library/Logs/Homebrew/#{formula}/" if not ARGV.verbose?
if ARGV.verbose? puts
puts "#{Tty.red}READ THIS#{Tty.reset}: #{Tty.em}#{ISSUES_URL}#{Tty.reset}"
else
require 'cmd/--config' require 'cmd/--config'
require 'cmd/--env' require 'cmd/--env'
ohai "Configuration" ohai "Configuration"
Homebrew.dump_build_config Homebrew.dump_build_config
ohai "ENV" ohai "ENV"
Homebrew.dump_build_env(env) Homebrew.dump_build_env(env)
end
puts puts
onoe "#{formula.name} did not build" onoe "#{formula.name} did not build"
puts "Logs: #{logs}" unless Dir["#{logs}/*"].empty? unless (logs = Dir["#{ENV['HOME']}/Library/Logs/Homebrew/#{formula}/*"]).empty?
puts "Help: #{Tty.em}#{ISSUES_URL}#{Tty.reset}" print "Logs: "
issues = GitHub.issues_for_formula(formula.name) puts *logs.map{|fn| " #{fn}"}
puts *issues.map{ |s| " #{Tty.em}#{s}#{Tty.reset}" } unless issues.empty? end
end
puts
unless issues.empty?
puts "These open issues may also help:"
puts *issues.map{ |s| " #{s}" }
end
end end
end end

View File

@ -11,6 +11,7 @@ class Tty
def reset; escape 0; end def reset; escape 0; end
def em; underline 39; end def em; underline 39; end
def green; color 92 end def green; color 92 end
def gray; bold 30 end
def width def width
`/usr/bin/tput cols`.strip.to_i `/usr/bin/tput cols`.strip.to_i