1
0
mirror of https://github.com/go-task/task.git synced 2025-08-10 22:42:19 +02:00

IgnoreError

* Document ignore_error
* ignore_error only for commands
This commit is contained in:
Tobias Salzmann
2018-08-01 10:44:53 +02:00
parent 05600601ff
commit 108cb91d95
6 changed files with 55 additions and 56 deletions

View File

@@ -632,6 +632,35 @@ tasks:
- echo "This will print nothing" > /dev/null
```
## Ignore errors
You have the option to ignore errors during command execution.
Given the following Taskfile:
```yml
version: '2'
tasks:
echo:
cmds:
- exit 1
- echo "Hello World"
```
Task will abort the execution after running `exit 1` because the status code `1` stands for `EXIT_FAILURE`.
However it is possible to continue with execution using `ignore_errors`:
```yml
version: '2'
tasks:
echo:
cmds:
- cmd: exit 1
ignore_errors: true
- echo "Hello World"
```
## Output syntax
By default, Task just redirect the STDOUT and STDERR of the running commands