mirror of
https://github.com/go-task/task.git
synced 2025-02-03 13:22:11 +02:00
Add CHANGELOG + Small improvement for #563
This commit is contained in:
parent
8b38ddfcd9
commit
78792bd11c
@ -2,6 +2,8 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Add `interactive: true` setting to improve support for interactive CLI apps
|
||||
([#217](https://github.com/go-task/task/issues/217), [#563](https://github.com/go-task/task/pull/563)).
|
||||
- Fix some `nil` errors
|
||||
([#534](https://github.com/go-task/task/issues/534), [#573](https://github.com/go-task/task/pull/573)).
|
||||
- Add ability to declare an included Taskfile as optional
|
||||
|
@ -950,6 +950,28 @@ $ task default
|
||||
|
||||
> The `output` option can also be specified by the `--output` or `-o` flags.
|
||||
|
||||
## Interactive CLI application
|
||||
|
||||
When running interactive CLI applications inside Task they can sometimes behave
|
||||
weirdly, specially when the [output mode](#output-syntax) is set to something
|
||||
other than `interleaved` (the default), or when interactive apps are ran in
|
||||
parallel with other tasks.
|
||||
|
||||
The `interactive: true` tells Task this is an interactive application, and Task
|
||||
will try to optimize for it:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
cmds:
|
||||
- vim my-file.txt
|
||||
interactive: true
|
||||
```
|
||||
|
||||
If you still have problem running an interactive app through Task, please open
|
||||
an issue about it.
|
||||
|
||||
## Short task syntax
|
||||
|
||||
Starting on Task v3, you can now write tasks with a shorter syntax if they
|
||||
|
9
task.go
9
task.go
@ -415,13 +415,12 @@ func (e *Executor) runCommand(ctx context.Context, t *taskfile.Task, call taskfi
|
||||
return nil
|
||||
}
|
||||
|
||||
stdOut := e.Output.WrapWriter(e.Stdout, t.Prefix)
|
||||
stdErr := e.Output.WrapWriter(e.Stderr, t.Prefix)
|
||||
|
||||
outputWrapper := e.Output
|
||||
if t.Interactive {
|
||||
stdOut = output.Interleaved{}.WrapWriter(e.Stdout, t.Prefix)
|
||||
stdErr = output.Interleaved{}.WrapWriter(e.Stderr, t.Prefix)
|
||||
outputWrapper = output.Interleaved{}
|
||||
}
|
||||
stdOut := outputWrapper.WrapWriter(e.Stdout, t.Prefix)
|
||||
stdErr := outputWrapper.WrapWriter(e.Stderr, t.Prefix)
|
||||
|
||||
defer func() {
|
||||
if _, ok := stdOut.(*os.File); !ok {
|
||||
|
Loading…
x
Reference in New Issue
Block a user