dynamic variable concatenation
# Taskfile.yml
version: '2'
vars:
staticTopLevelVar: static
dynamicTopLevelVar: '{{ .pfx }}:{{ .staticTopLevelVar }}'
.dynamic_vars: &dynamic_vars
dynamicVar: '{{ .pfx }}:{{ .staticTopLevelVar }}'
dynamicVarReferencesOtherDynamicVar: '{{ .dynamicVar }}:dynamicVarReferencesOtherDynamicVar'
tasks:
echo:
cmds:
- echo '{{ .staticTopLevelVar }}'
- echo '{{ .dynamicTopLevelVar }}'
- echo '{{ .dynamicVar }}'
- echo '{{ .dynamicVarReferencesOtherDynamicVar }}'
vars:
<<: *dynamic_vars
silent: true
as you can see, you cannot concatenate top level vars.
you have to use task vars to concatenate predefined vars with argument vars.
task echo pfx=my-prefix
static
<no value>:static
my-prefix:static
my-prefix:static:dynamicVarReferencesOtherDynamicVar