Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix: Console error on manual cancel when not using hot reload

Daniel Hougaard5fd975b1d75a
diff --git a/cli/packages/cmd/run.go b/cli/packages/cmd/run.go
index 28617f5728..89dd045920 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")
}