go-task / task

A task runner / simpler Make alternative written in Go
https://taskfile.dev
MIT License
11.36k stars 612 forks source link

Declaration order matters when nesting dynamic vars #1626

Open sedyh opened 6 months ago

sedyh commented 6 months ago

As far as I know you can nest dynamic variables in each other, but this behavior is depends on declaration order. Looks like a bit confusing. I didn't find this info in docs.

vars:
  A:
    sh: echo "a {{.B}}"
  B:
    sh: echo "b {{.C}}"
  C:
    sh: echo "c"
cmd
vars:
  C:
    sh: echo "c"
  B:
    sh: echo "b {{.C}}"
  A:
    sh: echo "a {{.B}}"
cmd a b c
vmaerten commented 5 months ago

Hello @sedyh Yes declaration order matters, it's on purpose. I'll add it to the doc