feat: add PrintCommand support to all task executors

This commit is contained in:
Jose Diaz-Gonzalez committed 2025-11-09 20:21:10 -05:00
1 parent b9025f6137
commit 5e85038d9c
4 files changed
+11 -4

No files matched your search

+4 -1
View File
@@ -19,6 +19,9 @@ type PlugnTriggerInput struct {
// Env is the environment variables to pass to the trigger
Env map[string]string
// PrintCommand prints the command before executing
PrintCommand bool
// Stdin is the stdin of the command
Stdin io.Reader
@@ -55,7 +58,7 @@ func CallPlugnTriggerWithContext(ctx context.Context, input PlugnTriggerInput) (
StreamStderr: input.StreamStderr,
})
if os.Getenv("DOKKU_TRACE") == "1" {
if input.PrintCommand || os.Getenv("DOKKU_TRACE") == "1" {
for _, line := range strings.Split(result.Stderr, "\n") {
LogDebug(fmt.Sprintf("plugn trigger %s stderr: %s", input.Trigger, line))
}