diff --git a/cmd/watcher/main.go b/cmd/watcher/main.go index 025dcc2..88d2e69 100644 --- a/cmd/watcher/main.go +++ b/cmd/watcher/main.go @@ -134,15 +134,17 @@ func main() { }() // Run the command before watcher starts if one was specified. - if *cmd != "" && *startcmd { - c := exec.Command(cmdName, cmdArgs...) - c.Stdin = os.Stdin - c.Stdout = os.Stdout - c.Stderr = os.Stderr - if err := c.Run(); err != nil { - log.Fatalln(err) + go func() { + if *cmd != "" && *startcmd { + c := exec.Command(cmdName, cmdArgs...) + c.Stdin = os.Stdin + c.Stdout = os.Stdout + c.Stderr = os.Stderr + if err := c.Run(); err != nil { + log.Fatalln(err) + } } - } + }() // Start the watching process. if err := w.Start(parsedInterval); err != nil {