fix: do not print command directly and instead use LogWarn to send to stdout

If we use the standard logging method from go-execute, any subprocess calls through plugn may capture the wrong output due to handling stdout.
This commit is contained in:
Jose Diaz-Gonzalez
2024-02-21 18:15:11 -05:00
parent 05c48430c5
commit 3843ac2de2

View File

@@ -125,7 +125,11 @@ func CallExecCommandWithContext(ctx context.Context, input ExecCommandInput) (Ex
} }
if os.Getenv("DOKKU_TRACE") == "1" { if os.Getenv("DOKKU_TRACE") == "1" {
cmd.PrintCommand = true argsSt := ""
if len(cmd.Args) > 0 {
argsSt = strings.Join(cmd.Args, " ")
}
LogWarn(fmt.Sprintf("exec: %s %s", cmd.Command, argsSt))
} }
if input.Stdin != nil { if input.Stdin != nil {