mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-04-10 17:47:19 +00:00
Ignore prerelease updates
This commit is contained in:
parent
b0ae3c3eb7
commit
3801510731
@ -44,6 +44,7 @@ extension Updater {
|
||||
|
||||
func evaluate(release: Release) {
|
||||
guard !userIgnored(release: release) else { return }
|
||||
guard !release.prerelease else { return }
|
||||
let latestVersion = semVer(from: release.name)
|
||||
let currentVersion = semVer(from: Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String)
|
||||
for (latest, current) in zip(latestVersion, currentVersion) {
|
||||
@ -85,11 +86,13 @@ extension Updater {
|
||||
public struct Release: Codable {
|
||||
|
||||
public let name: String
|
||||
public let prerelease: Bool
|
||||
public let html_url: URL
|
||||
public let body: String
|
||||
|
||||
public init(name: String, html_url: URL, body: String) {
|
||||
public init(name: String, prerelease: Bool, html_url: URL, body: String) {
|
||||
self.name = name
|
||||
self.prerelease = prerelease
|
||||
self.html_url = html_url
|
||||
self.body = body
|
||||
}
|
||||
|
@ -11,9 +11,9 @@ class PreviewUpdater: UpdaterProtocol {
|
||||
case .none:
|
||||
self.update = nil
|
||||
case .advisory:
|
||||
self.update = Release(name: "10.10.10", html_url: URL(string: "https://example.com")!, body: "Some regular update")
|
||||
self.update = Release(name: "10.10.10", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Some regular update")
|
||||
case .critical:
|
||||
self.update = Release(name: "10.10.10", html_url: URL(string: "https://example.com")!, body: "Critical Security Update")
|
||||
self.update = Release(name: "10.10.10", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Critical Security Update")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user