From 544d37bbc47d857c3df350105a3d00f46b697f19 Mon Sep 17 00:00:00 2001 From: David Flanagan Date: Sun, 10 Dec 2023 16:13:38 +0000 Subject: [PATCH] fix: "Injecting..." status stirng can be omitted by log levels When using `infisical run`, I am often running another command that needs to be processed or consumed by another; such as: infisical run -- supabase status -o env The Injecting string was being printed directly to stdout and stopping such scripting from being successful, without further adding tail -n+2. This change defaults the output to the INFO logging level, which means the behaviour is the exact same for everything; however those who wish can omit this output with -l error|fatal --- cli/packages/cmd/run.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/packages/cmd/run.go b/cli/packages/cmd/run.go index ef83bc10c..8aa5306d9 100644 --- a/cli/packages/cmd/run.go +++ b/cli/packages/cmd/run.go @@ -204,7 +204,8 @@ func init() { func executeSingleCommandWithEnvs(args []string, secretsCount int, env []string) error { command := args[0] argsForCommand := args[1:] - color.Green("Injecting %v Infisical secrets into your application process", secretsCount) + + log.Info().Msgf(color.GreenString("Injecting %v Infisical secrets into your application process", secretsCount)) cmd := exec.Command(command, argsForCommand...) cmd.Stdin = os.Stdin @@ -232,7 +233,7 @@ func executeMultipleCommandWithEnvs(fullCommand string, secretsCount int, env [] cmd.Stderr = os.Stderr cmd.Env = env - color.Green("Injecting %v Infisical secrets into your application process", secretsCount) + log.Info().Msgf(color.GreenString("Injecting %v Infisical secrets into your application process", secretsCount)) log.Debug().Msgf("executing command: %s %s %s \n", shell[0], shell[1], fullCommand) return execCmd(cmd)