Merge pull request #552 from justafish/justafish/519/optional-includes

Allow includes to be optional
This commit is contained in:
Andrey Nering
2021-09-25 09:36:44 -03:00
committed by GitHub
8 changed files with 93 additions and 1 deletions

View File

@@ -154,6 +154,24 @@ includes:
> This was a deliberate decision to keep use and implementation simple.
> If you disagree, open an GitHub issue and explain your use case. =)
### Optional includes
Includes marked as optional will allow Task to continue execution as normal if
the included file is missing.
```yaml
version: '3'
includes:
tests:
taskfile: ./tests/Taskfile.yml
optional: true
tasks:
greet:
cmds:
- echo "This command can still be successfully executed if ./tests/Taskfile.yml does not exist"
```
## Task directory
By default, tasks will be executed in the directory where the Taskfile is