Simplify target existence checks

This commit is contained in:
2025-06-01 15:24:31 -04:00
parent 5f8789a0f0
commit d0f7b663d5
9 changed files with 91 additions and 81 deletions
+5 -2
View File
@@ -9,8 +9,11 @@ import (
// GetOldEntryData decrypts and returns old entry data (with all required lines present).
func GetOldEntryData(targetLocation string, field int) ([]string, error) {
// ensure targetLocation exists
back.TargetIsFile(targetLocation, true, 2)
// ensure targetLocation exists and is a file
_, err := back.TargetIsFile(targetLocation, true)
if err != nil {
return nil, err
}
// read old entry data
decryptedEntry, err := crypt.DecryptFileToSlice(targetLocation)