1
0
mirror of https://github.com/go-task/task.git synced 2024-12-14 10:52:43 +02:00
Commit Graph

15 Commits

Author SHA1 Message Date
Andrey Nering
1c782c599f Remove deprecated "$" and "^" prefixes
`$` was a variable prefix that make it being evaluated as shell. It was
replaced with `sh:`.

`^` is a command prefix that make it run another task. It was replaced
with `task:`.

These were added long ago when we were experimenting with stuff and kept for
some time for backward compatibility reasons, but sometimes causes confusion
and I think the time to remove the code came.

Closes #644
Closes #645
Ref #642

Co-authored-by: Trite <60318513+Trite8Q1@users.noreply.github.com>
2022-01-02 15:26:42 -03:00
Andrey Nering
e086b654aa Environment from .env file should be available as variables
Fixes #379
2021-01-12 11:11:40 -03:00
Andrey Nering
68ce8642b1 Create v3 compiler which respects declaration order of variables
Also, fix "<no value>" been printed when a non-existing variable is printed.
2020-05-16 15:46:07 -03:00
Andrey Nering
7373639f57 Expose .TASK variable with the task name
Closes #252
2019-12-07 19:43:10 -03:00
jaedle
0f385f9f4e remove v1 2019-08-18 17:37:21 +02:00
Andrey Nering
4f368923a5 Upgrade own Taskfile to version 2 2018-03-04 16:20:26 -03:00
Andrey Nering
1a3df08aca Allow global variables in the Taskfile
Closes #66
2018-03-04 15:39:14 -03:00
Andrey Nering
2d4ca37226 Use semver for Taskfile versions 2018-03-03 18:54:42 -03:00
Andrey Nering
3556942516 Improve nested variables support
Closes #76 #89 #77 #83
2018-02-18 09:50:39 -03:00
Andrey Nering
48bf09da21 remove deprecated set keyword 2017-09-17 11:24:30 -03:00
Sindre Røkenes Myren
7a64530e83 Added suport for multiline variables from sh
Instead of giving an error on multiline results from sh, the results are
now stored as is, except that the last newline is stripped away to make
the output of most commands easy to use in shell commands.

Two helper functions have been added to help deal with multi-line
results. In addition, previous PascalCase template function names have
been renamed to camelCase for consistency with the sprig lib.
2017-09-04 10:14:09 +02:00
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
Andrey Nering
e8e914b11c use YAML for dynamix variable instead of $ prefix
$ prefix still works but is now deprecated

before:

    VAR: $echo var

after:

    VAR:
      sh: echo bar

closes #46
2017-07-15 15:28:59 -03:00
Andrey Nering
0db3e9a05d Fix "=" not being reconized in variables/environment variables
Fixes #19
2017-03-25 11:01:44 -03:00
Andrey Nering
e28b0bc646 Write tests for variables 2017-03-25 10:51:30 -03:00