1
0
mirror of https://github.com/go-task/task.git synced 2025-01-08 04:04:08 +02:00
task/testdata
Sindre Røkenes Myren 31faf05c3a Reintroduce template evaluation in variables
With a recent commit, template evaluation for variables in tasks got
broken. This reindroudces temmplate evaluation in taks, and resolves
a series of issues that where previouisly present on master, such as:

- Taskvars did not get evaluated as templates.
- Taskvars would, in contrast to the documentation, _override_ task
  variables for the taks called directly via `Executor.Run(args
  ...string)`. This caused different behaviour in the "default" task
  v.s. other tasks.

This commit ensures:
 - Priority order for variables is now according to the documentation,
   also for the "default" task.
 - Variables gets resolved in a particular order to ensure logical
   access to varaibles on template compile time, and that template
   compilation finds place _before_ resolution of dynamic variables.

This change also allows the following to work:

    task:
      vars:
        A: "52"
        B: "{{.A}}"

However, the following will always replace C with the uncompiled
`{{.A}}`:

    task:
      vars:
        A: "52"
        C: "{{.B}}"
        B: "{{.A}}"

Several tests have also been added to prevent this feature from breaking
again. This should hopefully finally resolve issue #40.
2017-07-22 00:50:23 +02:00
..
cyclic changed cyclic dep detection 2017-07-08 13:33:55 -03:00
deps Write first test for deps 2017-03-15 21:15:27 -03:00
generates Consider task up-to-date on equal timestamps 2017-07-12 18:18:26 +02:00
init Add --init flag to create a new Taskfile 2017-05-17 15:38:46 -03:00
params Reintroduce template evaluation in variables 2017-07-22 00:50:23 +02:00
status Add status option to prevent task from running 2017-05-17 14:37:16 -03:00
task_call Possibility to call another task 2017-03-25 15:26:42 -03:00
vars Reintroduce template evaluation in variables 2017-07-22 00:50:23 +02:00