|
|
|
|
@ -16,6 +16,7 @@ enum Patch: String, CaseIterable { |
|
|
|
|
case alexisLeDu |
|
|
|
|
case importDataFromDevToProd |
|
|
|
|
case fixMissingMatches |
|
|
|
|
case cleanLogs |
|
|
|
|
|
|
|
|
|
var id: String { |
|
|
|
|
return "padelclub.app.patch.\(self.rawValue)" |
|
|
|
|
@ -31,7 +32,7 @@ class Patcher { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static func patchIfPossible(_ patch: Patch) { |
|
|
|
|
if UserDefaults.standard.value(forKey: patch.id) == nil { |
|
|
|
|
// if UserDefaults.standard.value(forKey: patch.id) == nil { |
|
|
|
|
do { |
|
|
|
|
Logger.log(">>> Patches \(patch.rawValue)...") |
|
|
|
|
try self._applyPatch(patch) |
|
|
|
|
@ -39,7 +40,7 @@ class Patcher { |
|
|
|
|
} catch { |
|
|
|
|
Logger.error(error) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fileprivate static func _applyPatch(_ patch: Patch) throws { |
|
|
|
|
@ -47,6 +48,7 @@ class Patcher { |
|
|
|
|
case .alexisLeDu: self._patchAlexisLeDu() |
|
|
|
|
case .importDataFromDevToProd: try self._importDataFromDev() |
|
|
|
|
case .fixMissingMatches: self._patchMissingMatches() |
|
|
|
|
case .cleanLogs: self._cleanLogs() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -161,4 +163,7 @@ class Patcher { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fileprivate static func _cleanLogs() { |
|
|
|
|
StoreCenter.main.resetLoggingCollections() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|