Fix backup/temp directory cleaning in EntryRefresh()

This commit is contained in:
2025-05-31 19:20:51 -04:00
parent ca277ba773
commit 2840ff3cf2
+2 -2
View File
@@ -32,10 +32,10 @@ func EntryRefresh(oldRCWPassphrase, newRCWPassphrase []byte, removeOldDir bool)
for i, dirEnd := range dirEnds { for i, dirEnd := range dirEnds {
if i == 1 && !removeOldDir { if i == 1 && !removeOldDir {
if _, err := os.Stat(global.EntryRoot + dirEnd); !os.IsNotExist(err) { if _, err := os.Stat(global.EntryRoot + dirEnd); !os.IsNotExist(err) {
return errors.New("unable to refresh entries: \"" + global.EntryRoot + "-new\" already exists") return errors.New("unable to refresh entries: \"" + global.EntryRoot + dirEnd + "\" already exists")
} }
} }
os.RemoveAll(global.EntryRoot + "-new") os.RemoveAll(global.EntryRoot + dirEnd)
} }
// create output directory structure (global.EntryRoot + "-new"/*) // create output directory structure (global.EntryRoot + "-new"/*)