mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-05 13:24:43 +00:00
refactor: attempted autoupdate configuration
This commit is contained in:
committed by
Mitchell Hashimoto
parent
5e553f2743
commit
fd9d38481b
@@ -108,7 +108,13 @@ class AppDelegate: NSObject,
|
||||
|
||||
// Initial config loading
|
||||
configDidReload(ghostty)
|
||||
|
||||
|
||||
updaterController.updater.updateCheckInterval = 60
|
||||
updaterController.updater.automaticallyChecksForUpdates =
|
||||
ghostty.config.autoUpdates == "check" || ghostty.config.autoUpdates == "download"
|
||||
updaterController.updater.automaticallyDownloadsUpdates =
|
||||
ghostty.config.autoUpdates == "download"
|
||||
|
||||
// Register our service provider. This must happen after everything is initialized.
|
||||
NSApp.servicesProvider = ServiceProvider()
|
||||
|
||||
|
||||
@@ -360,6 +360,17 @@ extension Ghostty {
|
||||
_ = ghostty_config_get(config, &v, key, UInt(key.count))
|
||||
return v;
|
||||
}
|
||||
|
||||
var autoUpdates: String {
|
||||
let defaultValue = "off"
|
||||
guard let config = self.config else { return defaultValue }
|
||||
let key = "auto-updates"
|
||||
|
||||
var value: UnsafePointer<Int8>? = nil
|
||||
guard ghostty_config_get(config, &value, key, UInt(key.count)) else { return defaultValue }
|
||||
guard let pointer = value else { return defaultValue }
|
||||
return String(cString: pointer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user