Skip to content

Commit

Permalink
Add CHANGELOG, documentation and make small adjutsment for #755
Browse files Browse the repository at this point in the history
  • Loading branch information
andreynering committed Jun 11, 2022
1 parent 63aad1e commit c9a582f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions cmd/task/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
1 change: 1 addition & 0 deletions docs/docs/api_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
1 change: 1 addition & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package task
import (
"errors"
"fmt"

"mvdan.cc/sh/v3/interp"
)

Expand Down

0 comments on commit c9a582f

Please sign in to comment.