From f6c9990f3828b97d70f3d9f52d2e2bf1cadc0665 Mon Sep 17 00:00:00 2001 From: Joao Goncalves Date: Thu, 13 Nov 2025 12:30:45 -0100 Subject: [PATCH] feat: devmode removes the persist file after successful restore --- via.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/via.go b/via.go index 9cc88c6..8ea2b99 100644 --- a/via.go +++ b/via.go @@ -244,7 +244,10 @@ func (v *V) devModeRestore() { p := filepath.Join(".via", "devmode", "ctx.json") file, err := os.Open(p) if err != nil { - v.logWarn(nil, "devmode could not restore ctx from file: %v", err) + if os.IsNotExist(err) { + return + } + v.logErr(nil, "devmode could not restore ctx from file: %v", err) return } defer file.Close() @@ -265,6 +268,7 @@ func (v *V) devModeRestore() { v.registerCtx(c) } v.logDebug(nil, "devmode restored ctx registry") + os.Remove(p) } // New creates a new *V application with default configuration.