Fix #258: Remove existing key files before moving new ones to the same location
This commit is contained in:
parent
c8860fc36f
commit
adff0c1142
1 changed files with 7 additions and 0 deletions
|
|
@ -838,10 +838,17 @@ public class PasswordStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
public func gitSSHKeyImportFromFileSharing() throws {
|
public func gitSSHKeyImportFromFileSharing() throws {
|
||||||
|
if gitSSHKeyExists() {
|
||||||
|
try fm.removeItem(atPath: Globals.gitSSHPrivateKeyPath)
|
||||||
|
}
|
||||||
try fm.moveItem(atPath: Globals.iTunesFileSharingSSHPrivate, toPath: Globals.gitSSHPrivateKeyPath)
|
try fm.moveItem(atPath: Globals.iTunesFileSharingSSHPrivate, toPath: Globals.gitSSHPrivateKeyPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func pgpKeyImportFromFileSharing() throws {
|
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.iTunesFileSharingPGPPublic, toPath: Globals.pgpPublicKeyPath)
|
||||||
try fm.moveItem(atPath: Globals.iTunesFileSharingPGPPrivate, toPath: Globals.pgpPrivateKeyPath)
|
try fm.moveItem(atPath: Globals.iTunesFileSharingPGPPrivate, toPath: Globals.pgpPrivateKeyPath)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue