Clone if password store directory is not existed
This commit is contained in:
parent
eff8d11c1e
commit
88bf3a0d18
2 changed files with 7 additions and 1 deletions
|
|
@ -104,7 +104,8 @@ class SettingsTableViewController: UITableViewController {
|
|||
Defaults[.gitRepositoryURL]!.absoluteString != gitRepostiroyURL ||
|
||||
auth != Defaults[.gitRepositoryAuthenticationMethod] ||
|
||||
username != Defaults[.gitRepositoryUsername] ||
|
||||
password != PasswordStore.shared.gitRepositoryPassword {
|
||||
password != PasswordStore.shared.gitRepositoryPassword ||
|
||||
PasswordStore.shared.exists() == false {
|
||||
|
||||
SVProgressHUD.setDefaultMaskType(.black)
|
||||
SVProgressHUD.setDefaultStyle(.light)
|
||||
|
|
|
|||
|
|
@ -180,6 +180,11 @@ class PasswordStore {
|
|||
return pgp.getKeysOf(.secret)[0]
|
||||
}
|
||||
|
||||
func exists() -> Bool {
|
||||
let fm = FileManager()
|
||||
return fm.fileExists(atPath: Globals.repositoryPath)
|
||||
}
|
||||
|
||||
func initPGP(pgpPublicKeyURL: URL, pgpPublicKeyLocalPath: String, pgpPrivateKeyURL: URL, pgpPrivateKeyLocalPath: String) throws {
|
||||
let pgpPublicData = try Data(contentsOf: pgpPublicKeyURL)
|
||||
try pgpPublicData.write(to: URL(fileURLWithPath: pgpPublicKeyLocalPath), options: .atomic)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue