Skip to content
Snippets Groups Projects
Commit 2d505754 authored by Jack Nagel's avatar Jack Nagel
Browse files

Use Formula tap methods instead of matching the path

parent 6e60b1d8
No related branches found
No related tags found
No related merge requests found
......@@ -62,14 +62,13 @@ module Homebrew
end
def github_info f
if f.path.to_s =~ HOMEBREW_TAP_PATH_REGEX
user = $1
repo = $2
path = $3
if f.tap?
user, repo = f.tap.split("/", 2)
path = f.path.relative_path_from(HOMEBREW_LIBRARY.join("Taps", f.tap))
else
user = f.path.parent.cd { github_fork }
repo = "homebrew"
path = "Library/Formula/#{f.path.basename}"
path = f.path.relative_path_from(HOMEBREW_REPOSITORY)
end
"https://github.com/#{user}/#{repo}/blob/master/#{path}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment