mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2024-11-10 06:14:38 +03:00
only write plists if file has changed
This commit is contained in:
parent
3d87c61342
commit
0cf2ca9fa0
@ -43,6 +43,11 @@ public class ProjectWriter {
|
||||
|
||||
private func writePlist(_ plist: [String: Any], path: String) throws {
|
||||
let path = project.basePath + path
|
||||
if path.exists, let data: Data = try? path.read(),
|
||||
let existingPlist = (try? PropertyListSerialization.propertyList(from: data, format: nil)) as? [String: Any], NSDictionary(dictionary: plist).isEqual(to: existingPlist) {
|
||||
// file is the same
|
||||
return
|
||||
}
|
||||
let data = try PropertyListSerialization.data(fromPropertyList: plist, format: .xml, options: 0)
|
||||
try? path.delete()
|
||||
try path.parent().mkpath()
|
||||
|
Loading…
Reference in New Issue
Block a user