aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorXu Cheng2015-11-02 19:11:17 +0800
committerMike McQuaid2015-02-13 11:33:51 +0000
commitbd90ab5ef7028b72fe1c0bbd25d704a09ce73768 (patch)
treebd68f3a77b2d83685d7377cad4d3738c7378778c /Library/Homebrew/cmd
parentaebcaa79f12726213c2ed652025046e420a15b17 (diff)
downloadhomebrew-bd90ab5ef7028b72fe1c0bbd25d704a09ce73768.tar.bz2
info: show correct file origin for formula from path or url
Closes #36733. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/info.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb
index a1f903b7b..74443a41c 100644
--- a/Library/Homebrew/cmd/info.rb
+++ b/Library/Homebrew/cmd/info.rb
@@ -65,13 +65,14 @@ module Homebrew
if f.tap?
user, repo = f.tap.split("/", 2)
path = f.path.relative_path_from(HOMEBREW_LIBRARY.join("Taps", f.tap))
- else
+ "https://github.com/#{user}/#{repo}/blob/master/#{path}"
+ elsif f.core_formula?
user = f.path.parent.cd { github_fork }
- repo = "homebrew"
path = f.path.relative_path_from(HOMEBREW_REPOSITORY)
+ "https://github.com/#{user}/homebrew/blob/master/#{path}"
+ else
+ f.path
end
-
- "https://github.com/#{user}/#{repo}/blob/master/#{path}"
end
def info_formula f