1
0
mirror of https://github.com/go-task/task.git synced 2025-06-17 00:17:51 +02:00

Add CHANGELOG + Small improvement for #563

This commit is contained in:
Andrey Nering
2021-09-26 21:55:31 -03:00
parent 8b38ddfcd9
commit 78792bd11c
3 changed files with 28 additions and 5 deletions

View File

@ -2,6 +2,8 @@
## Unreleased ## 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 - Fix some `nil` errors
([#534](https://github.com/go-task/task/issues/534), [#573](https://github.com/go-task/task/pull/573)). ([#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 - Add ability to declare an included Taskfile as optional

View File

@ -950,6 +950,28 @@ $ task default
> The `output` option can also be specified by the `--output` or `-o` flags. > 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 ## Short task syntax
Starting on Task v3, you can now write tasks with a shorter syntax if they Starting on Task v3, you can now write tasks with a shorter syntax if they

View File

@ -415,13 +415,12 @@ func (e *Executor) runCommand(ctx context.Context, t *taskfile.Task, call taskfi
return nil return nil
} }
stdOut := e.Output.WrapWriter(e.Stdout, t.Prefix) outputWrapper := e.Output
stdErr := e.Output.WrapWriter(e.Stderr, t.Prefix)
if t.Interactive { if t.Interactive {
stdOut = output.Interleaved{}.WrapWriter(e.Stdout, t.Prefix) outputWrapper = output.Interleaved{}
stdErr = output.Interleaved{}.WrapWriter(e.Stderr, t.Prefix)
} }
stdOut := outputWrapper.WrapWriter(e.Stdout, t.Prefix)
stdErr := outputWrapper.WrapWriter(e.Stderr, t.Prefix)
defer func() { defer func() {
if _, ok := stdOut.(*os.File); !ok { if _, ok := stdOut.(*os.File); !ok {