Merge pull request #267 from SimplyDanny/fix-258

Fix #258: Remove keys before moving new ones
This commit is contained in:
Yishi Lin 2019-05-16 18:43:26 +08:00 committed by GitHub
commit b154c04178
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -838,10 +838,17 @@ public class PasswordStore {
}
public func gitSSHKeyImportFromFileSharing() throws {
if gitSSHKeyExists() {
try fm.removeItem(atPath: Globals.gitSSHPrivateKeyPath)
}
try fm.moveItem(atPath: Globals.iTunesFileSharingSSHPrivate, toPath: Globals.gitSSHPrivateKeyPath)
}
public func pgpKeyImportFromFileSharing() throws {
if pgpKeyExists() {
try fm.removeItem(atPath: Globals.pgpPublicKeyPath)
try fm.removeItem(atPath: Globals.pgpPrivateKeyPath)
}
try fm.moveItem(atPath: Globals.iTunesFileSharingPGPPublic, toPath: Globals.pgpPublicKeyPath)
try fm.moveItem(atPath: Globals.iTunesFileSharingPGPPrivate, toPath: Globals.pgpPrivateKeyPath)
}