add Formula#aliases
Fixes Homebrew/homebrew#44331. Closes Homebrew/homebrew#44709. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
98633e03c6
commit
3d585d6e3f
@ -280,6 +280,18 @@ class Formula
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# All of aliases for the formula
|
||||||
|
def aliases
|
||||||
|
@aliases ||= if core_formula?
|
||||||
|
Formula.core_alias_reverse_table[name] || []
|
||||||
|
elsif tap?
|
||||||
|
user, repo = tap.split("/")
|
||||||
|
Tap.fetch(user, repo.sub("homebrew-", "")).alias_reverse_table[full_name] || []
|
||||||
|
else
|
||||||
|
[]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# The {Resource}s for the currently active {SoftwareSpec}.
|
# The {Resource}s for the currently active {SoftwareSpec}.
|
||||||
def resources
|
def resources
|
||||||
active_spec.resources.values
|
active_spec.resources.values
|
||||||
@ -1138,6 +1150,7 @@ class Formula
|
|||||||
"desc" => desc,
|
"desc" => desc,
|
||||||
"homepage" => homepage,
|
"homepage" => homepage,
|
||||||
"oldname" => oldname,
|
"oldname" => oldname,
|
||||||
|
"aliases" => aliases,
|
||||||
"versions" => {
|
"versions" => {
|
||||||
"stable" => (stable.version.to_s if stable),
|
"stable" => (stable.version.to_s if stable),
|
||||||
"bottle" => bottle ? true : false,
|
"bottle" => bottle ? true : false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user