Overwrite an existing profile configuration

This commit is contained in:
Davide De Rosa 2018-10-26 18:16:34 +02:00
parent 78abb8c764
commit 18c7de140e
1 changed files with 3 additions and 1 deletions

View File

@ -62,7 +62,9 @@ class ProfileConfigurationFactory {
func save(url: URL, for profile: ProfileConfigurationSource) throws -> URL {
let savedUrl = targetConfigurationURL(for: profile)
try FileManager.default.copyItem(at: url, to: savedUrl)
let fm = FileManager.default
try? fm.removeItem(at: savedUrl)
try fm.copyItem(at: url, to: savedUrl)
return savedUrl
}