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:
29
README.md
29
README.md
@@ -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
|
||||
|
Reference in New Issue
Block a user