1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2026-04-01 17:20:09 +02:00

🐛 Fix issue with version parser

This commit is contained in:
2022-05-10 19:01:37 +02:00
parent c16377c688
commit 78cb6922b3
2 changed files with 2 additions and 7 deletions

View File

@@ -86,14 +86,12 @@ class AppUpdateChecker {
+ "(\(onlineVersion.computerReadable) > \(currentVersion.computerReadable))") + "(\(onlineVersion.computerReadable) > \(currentVersion.computerReadable))")
notifyAboutNewerVersion(version: onlineVersion) notifyAboutNewerVersion(version: onlineVersion)
case .orderedSame: case .orderedSame:
// Check if the build number differs
if currentVersion.build != nil if currentVersion.build != nil
&& onlineVersion.build != nil && onlineVersion.build != nil
&& buildDiffers(currentVersion, onlineVersion, background) { && buildDiffers(currentVersion, onlineVersion, background) {
return return
} }
// If the build number does not differ... it's the same release
Log.info("The installed version (\(currentVersion.computerReadable)) matches the latest release " Log.info("The installed version (\(currentVersion.computerReadable)) matches the latest release "
+ "(\(onlineVersion.computerReadable)).") + "(\(onlineVersion.computerReadable)).")
if !background { notifyVersionDoesNotNeedUpgrade() } if !background { notifyVersionDoesNotNeedUpgrade() }

View File

@@ -63,14 +63,11 @@ class AppVersion {
} }
public static func fromCurrentVersion() -> AppVersion { public static func fromCurrentVersion() -> AppVersion {
return AppVersion( return AppVersion.from("\(App.shortVersion)_\(App.bundleVersion)")!
version: VersionExtractor.from(App.shortVersion)!,
build: App.bundleVersion
)
} }
var computerReadable: String { var computerReadable: String {
return "\(version)_\(build ?? "???")" return "\(version)_\(build ?? "0")"
} }
var humanReadable: String { var humanReadable: String {