1
0
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:
Andrey Nering
2017-07-08 14:46:49 -03:00
parent 7a7f66dfdc
commit 50f592c540
2 changed files with 32 additions and 36 deletions

View File

@@ -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: