fix deleting directory
this used to corrupt the local state (password entities remained in DB but files/dirs were removed from git and disk)
This commit is contained in:
parent
12c8c04203
commit
98646242e0
4 changed files with 24 additions and 0 deletions
|
|
@ -273,6 +273,10 @@ public class PasswordStore {
|
|||
}
|
||||
|
||||
public func delete(passwordEntity: PasswordEntity) throws {
|
||||
if passwordEntity.isDir {
|
||||
throw AppError.cannotDeleteDirectory
|
||||
}
|
||||
|
||||
let deletedFileURL = passwordEntity.fileURL(in: storeURL)
|
||||
let deletedFilePath = passwordEntity.path
|
||||
try gitRm(path: passwordEntity.path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue