tab: fix typing of versions
This commit is contained in:
parent
5f2ccd22f2
commit
289fb5b393
@ -1233,7 +1233,7 @@ on_request: installed_on_request?, options: options)
|
|||||||
tab.time = Time.now.to_i
|
tab.time = Time.now.to_i
|
||||||
tab.aliases = formula.aliases
|
tab.aliases = formula.aliases
|
||||||
tab.arch = Hardware::CPU.arch
|
tab.arch = Hardware::CPU.arch
|
||||||
tab.source["versions"]["stable"] = formula.stable.version.to_s
|
tab.source["versions"]["stable"] = formula.stable.version&.to_s
|
||||||
tab.source["versions"]["version_scheme"] = formula.version_scheme
|
tab.source["versions"]["version_scheme"] = formula.version_scheme
|
||||||
tab.source["path"] = formula.specified_path.to_s
|
tab.source["path"] = formula.specified_path.to_s
|
||||||
tab.source["tap_git_head"] = formula.tap&.installed? ? formula.tap&.git_head : nil
|
tab.source["tap_git_head"] = formula.tap&.installed? ? formula.tap&.git_head : nil
|
||||||
|
|||||||
@ -45,8 +45,8 @@ class Tab
|
|||||||
"tap_git_head" => nil, # Filled in later if possible
|
"tap_git_head" => nil, # Filled in later if possible
|
||||||
"spec" => formula.active_spec_sym.to_s,
|
"spec" => formula.active_spec_sym.to_s,
|
||||||
"versions" => {
|
"versions" => {
|
||||||
"stable" => formula.stable&.version.to_s,
|
"stable" => formula.stable&.version&.to_s,
|
||||||
"head" => formula.head&.version.to_s,
|
"head" => formula.head&.version&.to_s,
|
||||||
"version_scheme" => formula.version_scheme,
|
"version_scheme" => formula.version_scheme,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -108,6 +108,11 @@ class Tab
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Tabs created with Homebrew 1.5.13 through 4.0.17 inclusive created empty string versions in some cases.
|
||||||
|
["stable", "head"].each do |spec|
|
||||||
|
attributes["source"]["versions"][spec] = attributes["source"]["versions"][spec].presence
|
||||||
|
end
|
||||||
|
|
||||||
new(attributes)
|
new(attributes)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -171,8 +176,8 @@ class Tab
|
|||||||
"tap" => formula.tap&.name,
|
"tap" => formula.tap&.name,
|
||||||
"spec" => formula.active_spec_sym.to_s,
|
"spec" => formula.active_spec_sym.to_s,
|
||||||
"versions" => {
|
"versions" => {
|
||||||
"stable" => formula.stable&.version.to_s,
|
"stable" => formula.stable&.version&.to_s,
|
||||||
"head" => formula.head&.version.to_s,
|
"head" => formula.head&.version&.to_s,
|
||||||
"version_scheme" => formula.version_scheme,
|
"version_scheme" => formula.version_scheme,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user