mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-14 11:37:43 +00:00
feat(mac): read Keyman Configuration version
This commit is contained in:
parent
de4c736cfe
commit
aaec0ad6ee
1 changed files with 4 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ import KeymanSettings
|
|||
|
||||
public class InstallationCheck {
|
||||
fileprivate let inputMethodVersion: String
|
||||
fileprivate let configurationVersion: String
|
||||
fileprivate let defaultsRepository: DefaultsRepo
|
||||
fileprivate let inputMethodUtil: InputMethodUtil
|
||||
fileprivate let inputMethodExists: Bool
|
||||
|
|
@ -21,15 +22,16 @@ public class InstallationCheck {
|
|||
public init(defaultsRepo: DefaultsRepo, inputMethodUtil: InputMethodUtil) {
|
||||
self.defaultsRepository = defaultsRepo
|
||||
self.inputMethodUtil = inputMethodUtil
|
||||
let exists = inputMethodUtil.keymanInputMethodExists()
|
||||
|
||||
if exists {
|
||||
if inputMethodUtil.keymanInputMethodExists() {
|
||||
self.inputMethodExists = true
|
||||
self.inputMethodVersion = (try? inputMethodUtil.getKeymanInputMethodVersion()) ?? "unknown"
|
||||
} else {
|
||||
self.inputMethodExists = false
|
||||
self.inputMethodVersion = "unknown"
|
||||
}
|
||||
|
||||
self.configurationVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "unknown"
|
||||
}
|
||||
|
||||
public func evaluate() -> InstallationState {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue