Merge branch 'develop'

This commit is contained in:
Sascha Andres
2017-03-03 08:55:19 +01:00
3 changed files with 161 additions and 10 deletions

View File

@@ -39,6 +39,55 @@ task assets build
If Bash is available (Linux and Windows while on Git Bash), the commands will
run in Bash, otherwise will fallback to `cmd` (on Windows).
### Variables
```yml
build:
deps: [setvar]
cmds:
- echo "{{prefix}} {{THEVAR}}"
variables:
prefix: "Path:"
setvar:
cmds:
- echo "{{PATH}}"
set: THEVAR
```
The above sample saves the path into a new variable which is then again echoed.
You can use environment variables, task level variables and a file called `Variables` as source of variables.
They are evaluated in the following order:
Task local variables are overwritten by variables found in `Variables`. Variables found in `Variables` are overwritten with variables from the environment. The output of the last command is stored in the environment. So you can do something like this:
```yml
build:
deps: [setvar]
cmds:
- echo "{{prefix}} '{{THEVAR}}'"
variables:
prefix: "Result: "
setvar:
cmds:
- echo -n "a"
- echo -n "{{THEVAR}}b"
- echo -n "{{THEVAR}}c"
set: THEVAR
```
The result of a run of build would be:
```
a
ab
abc
Result: 'abc'
```
### Task dependencies
You may have tasks that depends on others. Just pointing them on `deps` will