From f864a252ea0e08b4df04278d2a8d65ed92bba43d Mon Sep 17 00:00:00 2001 From: Louis Pontoise Date: Thu, 17 Oct 2019 02:13:29 +0900 Subject: [PATCH] fix: upgrade scenario didn't work properly --- alt-tab-macos/logic/Preferences.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/alt-tab-macos/logic/Preferences.swift b/alt-tab-macos/logic/Preferences.swift index abf46d27..77450a27 100644 --- a/alt-tab-macos/logic/Preferences.swift +++ b/alt-tab-macos/logic/Preferences.swift @@ -46,7 +46,8 @@ class Preferences: Decodable { try FileManager.default.copyItem(at: defaultFile, to: userFile) } else if try fileLines(defaultFile) > fileLines(userFile) { // TODO: handle upgrades in a smarter way (e.g. merge files) - let _ = try FileManager.default.replaceItemAt(defaultFile, withItemAt: userFile) + try FileManager.default.removeItem(at: userFile) + try FileManager.default.copyItem(at: defaultFile, to: userFile) } }