Use Formula tap methods instead of matching the path
This commit is contained in:
parent
6e60b1d8c3
commit
2d505754e7
@ -62,14 +62,13 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def github_info f
|
def github_info f
|
||||||
if f.path.to_s =~ HOMEBREW_TAP_PATH_REGEX
|
if f.tap?
|
||||||
user = $1
|
user, repo = f.tap.split("/", 2)
|
||||||
repo = $2
|
path = f.path.relative_path_from(HOMEBREW_LIBRARY.join("Taps", f.tap))
|
||||||
path = $3
|
|
||||||
else
|
else
|
||||||
user = f.path.parent.cd { github_fork }
|
user = f.path.parent.cd { github_fork }
|
||||||
repo = "homebrew"
|
repo = "homebrew"
|
||||||
path = "Library/Formula/#{f.path.basename}"
|
path = f.path.relative_path_from(HOMEBREW_REPOSITORY)
|
||||||
end
|
end
|
||||||
|
|
||||||
"https://github.com/#{user}/#{repo}/blob/master/#{path}"
|
"https://github.com/#{user}/#{repo}/blob/master/#{path}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user