mirror of
https://github.com/go-task/task.git
synced 2025-08-10 22:42:19 +02:00
refactor getVariables()
This commit is contained in:
18
README.md
18
README.md
@@ -277,8 +277,8 @@ They are listed below in order of importance (e.g. most important first):
|
||||
- Variables given while calling a task from another.
|
||||
(See [Calling another task](#calling-another-task) above)
|
||||
- Environment variables
|
||||
- Variables available in the `Taskvars.yml` file
|
||||
- Variables declared locally in the task
|
||||
- Variables available in the `Taskvars.yml` file
|
||||
|
||||
Example of overriding with environment variables:
|
||||
|
||||
@@ -286,14 +286,6 @@ Example of overriding with environment variables:
|
||||
$ TASK_VARIABLE=a-value task do-something
|
||||
```
|
||||
|
||||
Example of `Taskvars.yml` file:
|
||||
|
||||
```yml
|
||||
PROJECT_NAME: My Project
|
||||
DEV_MODE: production
|
||||
GIT_COMMIT: $git log -n 1 --format=%h
|
||||
```
|
||||
|
||||
Example of locally declared vars:
|
||||
|
||||
```yml
|
||||
@@ -304,6 +296,14 @@ print-var:
|
||||
VAR: Hello!
|
||||
```
|
||||
|
||||
Example of `Taskvars.yml` file:
|
||||
|
||||
```yml
|
||||
PROJECT_NAME: My Project
|
||||
DEV_MODE: production
|
||||
GIT_COMMIT: $git log -n 1 --format=%h
|
||||
```
|
||||
|
||||
> NOTE: It's also possible setting a variable globally using `set` attribute
|
||||
in task, but this is deprecated:
|
||||
|
||||
|
Reference in New Issue
Block a user