Merge pull request #15402 from Bo98/tab-version-type-fix
tab: fix typing of versions
This commit is contained in:
commit
082017e93d
@ -1233,7 +1233,7 @@ on_request: installed_on_request?, options: options)
|
||||
tab.time = Time.now.to_i
|
||||
tab.aliases = formula.aliases
|
||||
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["path"] = formula.specified_path.to_s
|
||||
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
|
||||
"spec" => formula.active_spec_sym.to_s,
|
||||
"versions" => {
|
||||
"stable" => formula.stable&.version.to_s,
|
||||
"head" => formula.head&.version.to_s,
|
||||
"stable" => formula.stable&.version&.to_s,
|
||||
"head" => formula.head&.version&.to_s,
|
||||
"version_scheme" => formula.version_scheme,
|
||||
},
|
||||
},
|
||||
@ -108,6 +108,11 @@ class Tab
|
||||
}
|
||||
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)
|
||||
end
|
||||
|
||||
@ -171,8 +176,8 @@ class Tab
|
||||
"tap" => formula.tap&.name,
|
||||
"spec" => formula.active_spec_sym.to_s,
|
||||
"versions" => {
|
||||
"stable" => formula.stable&.version.to_s,
|
||||
"head" => formula.head&.version.to_s,
|
||||
"stable" => formula.stable&.version&.to_s,
|
||||
"head" => formula.head&.version&.to_s,
|
||||
"version_scheme" => formula.version_scheme,
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user