cmd/info: refactor-github_info
This commit is contained in:
parent
a65ba2fbfe
commit
d2c0fdfbcc
@ -215,20 +215,14 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def github_info(f)
|
def github_info(f)
|
||||||
if f.tap
|
return f.path if f.tap.blank? || f.tap.remote.blank?
|
||||||
if remote = f.tap.remote
|
|
||||||
path = if f.class.superclass == Formula
|
path = if f.class.superclass == Formula
|
||||||
f.path.relative_path_from(f.tap.path)
|
f.path.relative_path_from(f.tap.path)
|
||||||
elsif f.is_a?(Cask::Cask)
|
elsif f.is_a?(Cask::Cask)
|
||||||
f.sourcefile_path.relative_path_from(f.tap.path)
|
f.sourcefile_path.relative_path_from(f.tap.path)
|
||||||
end
|
|
||||||
github_remote_path(remote, path)
|
|
||||||
else
|
|
||||||
f.path
|
|
||||||
end
|
|
||||||
else
|
|
||||||
f.path
|
|
||||||
end
|
end
|
||||||
|
github_remote_path(f.tap.remote, path)
|
||||||
end
|
end
|
||||||
|
|
||||||
def info_formula(f, args:)
|
def info_formula(f, args:)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user