refactor: attempted autoupdate configuration

This commit is contained in:
hanna
2024-07-19 10:04:48 -07:00
committed by Mitchell Hashimoto
parent 5e553f2743
commit fd9d38481b
4 changed files with 33 additions and 1 deletions

View File

@@ -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)
}
}
}