gist-logs: always post config and doctor output
Closes Homebrew/homebrew#32145.
This commit is contained in:
parent
1dd924b9bd
commit
793b58a686
@ -15,8 +15,10 @@ def gist_logs f
|
||||
|
||||
files = load_logs(f.name)
|
||||
|
||||
append_config(files) if ARGV.include? '--config'
|
||||
append_doctor(files) if ARGV.include? '--doctor'
|
||||
s = StringIO.new
|
||||
Homebrew.dump_verbose_config(s)
|
||||
files["config.out"] = { :content => s.string }
|
||||
files["doctor.out"] = { :content => `brew doctor 2>&1` }
|
||||
|
||||
url = create_gist(files)
|
||||
|
||||
@ -38,16 +40,6 @@ def load_logs name
|
||||
logs
|
||||
end
|
||||
|
||||
def append_config files
|
||||
s = StringIO.new
|
||||
Homebrew.dump_verbose_config(s)
|
||||
files["config.out"] = { :content => s.string }
|
||||
end
|
||||
|
||||
def append_doctor files
|
||||
files['doctor.out'] = {:content => `brew doctor 2>&1`}
|
||||
end
|
||||
|
||||
def create_gist files
|
||||
post("/gists", "public" => true, "files" => files)["html_url"]
|
||||
end
|
||||
@ -92,14 +84,8 @@ def post path, data
|
||||
Utils::JSON.load(body)
|
||||
end
|
||||
|
||||
def usage
|
||||
puts "usage: brew gist-logs [options] <formula>"
|
||||
puts
|
||||
puts "options: --config, --doctor, --new-issue"
|
||||
end
|
||||
|
||||
if ARGV.formulae.length != 1
|
||||
usage
|
||||
puts "usage: brew gist-logs [--new-issue] <formula>"
|
||||
exit 1
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user