Use Formula#tap to get the repository name
This commit is contained in:
parent
269405995e
commit
944ac75b24
@ -11,7 +11,6 @@ def gist_logs f
|
|||||||
puts 'and then set HOMEBREW_GITHUB_API_TOKEN to use --new-issue option.'
|
puts 'and then set HOMEBREW_GITHUB_API_TOKEN to use --new-issue option.'
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
repo = repo_name(f)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
files = load_logs(f.name)
|
files = load_logs(f.name)
|
||||||
@ -22,7 +21,7 @@ def gist_logs f
|
|||||||
url = create_gist(files)
|
url = create_gist(files)
|
||||||
|
|
||||||
if ARGV.include? '--new-issue'
|
if ARGV.include? '--new-issue'
|
||||||
url = new_issue(repo, "#{f.name} failed to build on #{MACOS_FULL_VERSION}", url)
|
url = new_issue(f.tap, "#{f.name} failed to build on #{MACOS_FULL_VERSION}", url)
|
||||||
end
|
end
|
||||||
|
|
||||||
ensure puts url if url
|
ensure puts url if url
|
||||||
@ -98,15 +97,6 @@ class HTTP_Error < RuntimeError
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def repo_name f
|
|
||||||
dir = f.path.dirname
|
|
||||||
url = dir.cd { `git config --get remote.origin.url` }
|
|
||||||
unless url =~ %r{github.com(?:/|:)([\w\d]+)/([\-\w\d]+)}
|
|
||||||
raise 'Unable to determine formula repository.'
|
|
||||||
end
|
|
||||||
"#{$1}/#{$2}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def usage
|
def usage
|
||||||
puts "usage: brew gist-logs [options] <formula>"
|
puts "usage: brew gist-logs [options] <formula>"
|
||||||
puts
|
puts
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user