Skip to content

Commit

Permalink
fix: upgrade scenario didn't work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Pontoise committed Oct 16, 2019
1 parent fa5a369 commit f864a25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion alt-tab-macos/logic/Preferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit f864a25

Please sign in to comment.