From 5fd975b1d75a08d8be0b5a604aecfeeeea5f2d38 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Tue, 27 Aug 2024 20:09:40 +0400 Subject: [PATCH] Fix: Console error on manual cancel when not using hot reload --- cli/packages/cmd/run.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cli/packages/cmd/run.go b/cli/packages/cmd/run.go index 28617f572..89dd04592 100644 --- a/cli/packages/cmd/run.go +++ b/cli/packages/cmd/run.go @@ -22,6 +22,8 @@ import ( "github.com/spf13/cobra" ) +var INTERRUPT_ERR = fmt.Errorf("signal: interrupt") + // runCmd represents the run command var runCmd = &cobra.Command{ Example: ` @@ -250,6 +252,10 @@ func executeSingleCommandWithEnvs(args []string, secretsCount int, env []string, err := startCmd() // Initial command start, if no --watch flag is passed, it will work like in old versions of infisical CLI. if err != nil { + if err.Error() == INTERRUPT_ERR.Error() { + log.Debug().Msg(color.HiMagentaString("Process was terminated manually by the user")) + os.Exit(1) + } util.HandleError(err, "Failed to start command") } @@ -343,6 +349,10 @@ func executeMultipleCommandWithEnvs(fullCommand string, secretsCount int, env [] err := startCmd() // Initial command start, if no --watch flag is passed, it will work like in old versions of infisical CLI. if err != nil { + if err.Error() == INTERRUPT_ERR.Error() { + log.Debug().Msg(color.HiMagentaString("Process was terminated manually by the user")) + os.Exit(1) + } util.HandleError(err, "Failed to start command") }