On v3, treat all CLI variables as global variables

Closes #336
Ref #341

Co-authored-by: Egor Kovetskiy <e.kovetskiy@gmail.com>
This commit is contained in:
Andrey Nering
2020-08-16 21:26:10 -03:00
parent e28b82b2b7
commit 6ff3c9015b
5 changed files with 138 additions and 14 deletions

View File

@@ -488,19 +488,11 @@ $ TASK_VARIABLE=a-value task do-something
Since some shells don't support above syntax to set environment variables
(Windows) tasks also accepts a similar style when not in the beginning of
the command. Variables given in this form are only visible to the task called
right before.
the command.
```bash
$ task write-file FILE=file.txt "CONTENT=Hello, World!" print "MESSAGE=All done!"
```
If you want to set global variables using this syntax, give it before any task:
```bash
$ task OUTPUT=file.txt generate-file
```
Example of locally declared vars:
```yaml