From 8181393670038db1d2eaea6d1933b72b86b239b4 Mon Sep 17 00:00:00 2001 From: kewegner <47402596+kewegner@users.noreply.github.com> Date: Tue, 10 Dec 2019 10:50:24 -0600 Subject: [PATCH] Do not run watcher during APPSODY_PREP command (#58) * temporary key change * reverted key * change image name and remove script file * image name changes CMD added * initial code drop * initial release * reap after no watcher normal exit * Move prep before watcher starts * Update main.go * gofmt issue --- main.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/main.go b/main.go index a94462c..9a4ec02 100644 --- a/main.go +++ b/main.go @@ -502,15 +502,7 @@ func runCommands(commandString string, theProcessType ProcessType, killServer bo cmps.mu.Lock() if theProcessType == server { - if appsodyPREP != "" { - ControllerDebug.log("Running APPSODY_PREP command: ", appsodyPREP) - _, err = runPrep(appsodyPREP, interactive) - } - if err != nil { - ControllerError.log("FATAL error APPSODY_PREP command received an error. The controller is exiting: ", err) - os.Exit(1) - } // keep going cmd, err = startProcess(commandString, server, interactive) ControllerDebug.log("Started RUN/DEBUG/TEST process") @@ -735,6 +727,16 @@ func main() { ControllerDebug.log("Done processing controller signal handler.") }() + if appsodyPREP != "" { + ControllerDebug.log("Running APPSODY_PREP command: ", appsodyPREP) + + _, err = runPrep(appsodyPREP, interactiveFlag) + } + if err != nil { + ControllerError.log("FATAL error APPSODY_PREP command received an error. The controller is exiting: ", err) + os.Exit(1) + } + if fileChangeCommand == "" || disableWatcher { ControllerDebug.log("The fileChangeCommand environment variable APPSODY_RUN/DEBUG/TEST_ON_CHANGE is unspecified or file watching was disabled by the CLI.") ControllerDebug.log("Running APPSODY_RUN,APPSODY_DEBUG or APPSODY_TEST sync: " + startCommand)