mirror of
https://github.com/go-task/task.git
synced 2026-07-07 22:18:47 +00:00
feat: variable references (#1654)
* feat: add references to the base code instead of the maps experiment * feat: add template functions to ref resolver * feat: tests * docs: variable references * feat: remove json and yaml keys from map variable experiment * chore: typo
This commit is contained in:
15
testdata/vars/any2/Taskfile.yml
vendored
15
testdata/vars/any2/Taskfile.yml
vendored
@@ -10,7 +10,6 @@ tasks:
|
||||
- task: ref-dep
|
||||
- task: ref-resolver
|
||||
- task: json
|
||||
- task: yaml
|
||||
|
||||
map:
|
||||
vars:
|
||||
@@ -93,25 +92,13 @@ tasks:
|
||||
JSON_STRING:
|
||||
sh: cat example.json
|
||||
JSON:
|
||||
json: "{{.JSON_STRING}}"
|
||||
ref: "fromJson .JSON_STRING"
|
||||
cmds:
|
||||
- task: print-story
|
||||
vars:
|
||||
VAR:
|
||||
ref: .JSON
|
||||
|
||||
yaml:
|
||||
vars:
|
||||
YAML_STRING:
|
||||
sh: cat example.yaml
|
||||
YAML:
|
||||
yaml: "{{.YAML_STRING}}"
|
||||
cmds:
|
||||
- task: print-story
|
||||
vars:
|
||||
VAR:
|
||||
ref: .YAML
|
||||
|
||||
print-var:
|
||||
cmds:
|
||||
- echo "{{.VAR}}"
|
||||
|
||||
Reference in New Issue
Block a user