From 4dab9f2c93e535d8d6abcfdf379ac3038b3ff557 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sat, 31 May 2025 20:41:30 -0400 Subject: [PATCH] Automatically install new entry directory in EntryRefresh() --- core/utilitiesMisc.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/utilitiesMisc.go b/core/utilitiesMisc.go index e197861..690ceed 100644 --- a/core/utilitiesMisc.go +++ b/core/utilitiesMisc.go @@ -104,6 +104,16 @@ func EntryRefresh(oldRCWPassphrase, newRCWPassphrase []byte, removeOldDir bool) } } + // swap the new directory with the old one + err = os.Rename(global.EntryRoot, global.EntryRoot+"-old") + if err != nil { + return errors.New("unable to rename old directory: " + err.Error()) + } + err = os.Rename(global.EntryRoot+"-new", global.EntryRoot) + if err != nil { + return errors.New("unable to rename new directory: " + err.Error()) + } + return nil }