1
0
mirror of https://github.com/go-task/task.git synced 2024-12-04 10:24:45 +02:00

Add CHANGELOG, documentation and make small adjutsment for #755

This commit is contained in:
Andrey Nering 2022-06-11 20:01:48 -03:00
parent 63aad1e501
commit c9a582fbcc
4 changed files with 12 additions and 4 deletions

View File

@ -1,5 +1,11 @@
# Changelog
## Unreleased
- Add new `--exit-code` (`-x`) flag that will pass-through the exit form the
command being ran
([#755](https://github.com/go-task/task/pull/755)).
## v3.12.1 - 2022-05-10
- Fixed bug where, on Windows, variables were ending with `\r` because we were

View File

@ -218,13 +218,13 @@ func main() {
if err := e.Run(ctx, calls...); err != nil {
e.Logger.Errf(logger.Red, "%v", err)
code := 1
if exitCode {
if tre, ok := err.(*task.TaskRunError); ok {
code = tre.ExitCode()
if err, ok := err.(*task.TaskRunError); ok {
os.Exit(err.ExitCode())
}
}
os.Exit(code)
os.Exit(1)
}
}

View File

@ -26,6 +26,7 @@ variable
| `-C` | `--concurrency` | `int` | `0` | Limit number tasks to run concurrently. Zero means unlimited. |
| `-d` | `--dir` | `string` | Working directory | Sets directory of execution. |
| | `--dry` | `bool` | `false` | Compiles and prints tasks in the order that they would be run, without executing them. |
| `-x` | `--exit-code` | `bool` | `false` | Pass-through the exit code of the task command. |
| `-f` | `--force` | `bool` | `false` | Forces execution even when the task is up-to-date. |
| `-h` | `--help` | `bool` | `false` | Shows Task usage. |
| `-i` | `--init` | `bool` | `false` | Creates a new Taskfile.yaml in the current folder. |

View File

@ -3,6 +3,7 @@ package task
import (
"errors"
"fmt"
"mvdan.cc/sh/v3/interp"
)