mirror of
https://github.com/go-task/task.git
synced 2026-06-29 15:44:30 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user