mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 15:01:41 +03:00
refactor: rename to openclaw
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import Foundation
|
||||
|
||||
private let legacyDefaultsPrefix = "openclaw."
|
||||
private let defaultsPrefix = "openclaw."
|
||||
|
||||
func migrateLegacyDefaults() {
|
||||
let defaults = UserDefaults.standard
|
||||
let snapshot = defaults.dictionaryRepresentation()
|
||||
for (key, value) in snapshot where key.hasPrefix(legacyDefaultsPrefix) {
|
||||
let suffix = key.dropFirst(legacyDefaultsPrefix.count)
|
||||
let newKey = defaultsPrefix + suffix
|
||||
if defaults.object(forKey: newKey) == nil {
|
||||
defaults.set(value, forKey: newKey)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user