aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-11-02 19:11:17 +0800
committerMike McQuaid2015-02-13 11:33:51 +0000
commit56f7208f8e3c510b779ade3729482217e5cb05d8 (patch)
tree161681f2cf415031e4578d3c19783e5237661ebe /Library
parente34d9a7b37101062c79a98ade47fe141a9b8e149 (diff)
downloadbrew-56f7208f8e3c510b779ade3729482217e5cb05d8.tar.bz2
info: show correct file origin for formula from path or url
Closes Homebrew/homebrew#36733. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-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