1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

First step implementing "prefixed" output option

Ref #104
This commit is contained in:
Andrey Nering
2018-04-22 15:41:53 -03:00
parent 051ff35878
commit a407b0a8eb
7 changed files with 77 additions and 5 deletions

View File

@@ -130,6 +130,8 @@ func (e *Executor) Setup() error {
e.Output = output.Interleaved{}
case "group":
e.Output = output.Group{}
case "prefixed":
e.Output = output.Prefixed{}
default:
return fmt.Errorf(`task: output option "%s" not recognized`, e.Taskfile.Output)
}
@@ -204,8 +206,8 @@ func (e *Executor) runCommand(ctx context.Context, t *taskfile.Task, call taskfi
e.Logger.Errf(cmd.Cmd)
}
stdOut := e.Output.WrapWriter(e.Stdout)
stdErr := e.Output.WrapWriter(e.Stderr)
stdOut := e.Output.WrapWriter(e.Stdout, t.Prefix)
stdErr := e.Output.WrapWriter(e.Stderr, t.Prefix)
defer stdOut.Close()
defer stdErr.Close()