Skip to content

Commit

Permalink
Handle non semvar version of Firefox
Browse files Browse the repository at this point in the history
Closes #87
  • Loading branch information
dz0ny committed Dec 13, 2021
1 parent 5db57fc commit 9a0f7a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Pareto/Checks/Firefox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ class AppFirefoxCheck: AppCheck {
"768a574c-75a2-536d-8785-ef9512981184"
}

override var currentVersion: Version {
if applicationPath == nil {
return Version(0, 0, 0)
}
let v = appVersion(path: applicationPath!)!.split(separator: ".")
if v.count == 2 {
return Version(Int(v[0]) ?? 0, Int(v[1]) ?? 0, 0)
}
return Version(Int(v[0]) ?? 0, Int(v[1]) ?? 0, Int(v[2]) ?? 0)
}

override func getLatestVersion(completion: @escaping (String) -> Void) {
let url = "https://product-details.mozilla.org/1.0/firefox_history_stability_releases.json"
os_log("Requesting %{public}s", url)
Expand Down
2 changes: 1 addition & 1 deletion Pareto/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>3622</string>
<string>3626</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down

0 comments on commit 9a0f7a7

Please sign in to comment.