From e66dcdb11a4a7d3be84572c27a73aababa3ee09f Mon Sep 17 00:00:00 2001 From: Nusiq Date: Mon, 14 Oct 2024 20:49:38 +0200 Subject: [PATCH] Preventing a potential issue of Regolith getting stuck in watch mode in case of failing to run the 'ExportProject' function. --- regolith/profile.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/regolith/profile.go b/regolith/profile.go index 80a7597..3517b11 100644 --- a/regolith/profile.go +++ b/regolith/profile.go @@ -146,12 +146,14 @@ start: context.fileWatchingStage <- "pause" } err = ExportProject(context) - if err != nil { - return burrito.WrapError(err, exportProjectError) - } if context.IsInWatchMode() { + // We need to restart the watcher before error handling. See: + // https://github.com/Bedrock-OSS/regolith/pull/297#issuecomment-2411981894 context.fileWatchingStage <- "restart" } + if err != nil { + return burrito.WrapError(err, exportProjectError) + } if context.IsInterrupted("data") { goto start }