Skip to content

Commit

Permalink
Switch installed/stable version in outdated
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaid Kokaja committed Jul 3, 2020
1 parent ea4c768 commit b6d05e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Brewlet/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, PreferencesDelegate {
*/
func fillPackageMenu(packageMenu : NSMenu, packages: [Package]) {
for package in packages {
let newVersion = package.versions.stable
let newVersion = package.getStableVersion()
let currentVersion = package.getInstalledVersion() ?? "?"
let title = "\(package.name) (\(currentVersion)) < \(newVersion)"

Expand Down
12 changes: 8 additions & 4 deletions Brewlet/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ struct Package {
var version: String? = nil
if !installed.isEmpty {
version = installed[0].version

if revision > 0 {
version! += "_\(self.revision)"
}
}
return version
}

func getStableVersion() -> String {
var version = self.versions.stable
if revision > 0 {
version += "_\(self.revision)"
}
return version
}
Expand Down

0 comments on commit b6d05e4

Please sign in to comment.