mirror of
https://github.com/go-task/task.git
synced 2025-08-10 22:42:19 +02:00
allow assigning variables to tasks at run time via CLI
using a similar syntax than setting env variables to command in bash, but used right after the task: ```bash task print MESSAGE=Hello! ``` closes #33
This commit is contained in:
@@ -279,6 +279,15 @@ Example of overriding with environment variables:
|
||||
$ 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.
|
||||
|
||||
```bash
|
||||
$ task write-file FILE=file.txt "CONTENT=Hello, World!" print "MESSAGE=All done!"
|
||||
```
|
||||
|
||||
Example of locally declared vars:
|
||||
|
||||
```yml
|
||||
|
Reference in New Issue
Block a user