mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
Task: Add interactive parameter
Add the task parameter "interactive" to force interleaved output in order to make interactive CLI apps work. Feature request in #217 TODO: * Update documentation Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io>
This commit is contained in:
6
task.go
6
task.go
@@ -417,6 +417,12 @@ func (e *Executor) runCommand(ctx context.Context, t *taskfile.Task, call taskfi
|
||||
|
||||
stdOut := e.Output.WrapWriter(e.Stdout, t.Prefix)
|
||||
stdErr := e.Output.WrapWriter(e.Stderr, t.Prefix)
|
||||
|
||||
if t.Interactive {
|
||||
stdOut = output.Interleaved{}.WrapWriter(e.Stdout, t.Prefix)
|
||||
stdErr = output.Interleaved{}.WrapWriter(e.Stderr, t.Prefix)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if _, ok := stdOut.(*os.File); !ok {
|
||||
if closer, ok := stdOut.(io.Closer); ok {
|
||||
|
||||
Reference in New Issue
Block a user