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
55672410cd
own Taskfile: small improvement of lint task
2017-07-19 20:24:40 -03:00
Andrey Nering
8a66857fb9
Merge branch 'silent'
2017-07-19 20:20:49 -03:00
Andrey Nering
d0b37df615
add silent mode to disable echoing of commands
2017-07-19 20:20:24 -03:00
Andrey Nering
dc6cb68327
rename file.go to status.go, and move related code there
2017-07-16 16:15:29 -03:00
Andrey Nering
72250b32d3
replace variables in a task once, instead of mixing these calls with unrelated code
...
this is the first big step of #45
now t.ReplaceVariable will return a copy of the task, but with variables
replaced
now we don't need to replace variables everywhere in the code, and will
make other refactorings easier
2017-07-16 16:09:55 -03:00
Andrey Nering
726130be09
v1.4.1
2017-07-15 15:52:33 -03:00
Andrey Nering
968a29d869
deduplicate conversion from dep and cmd to call
2017-07-15 15:46:53 -03:00
Andrey Nering
ce27e973be
hotpath for a blank variable template
2017-07-15 15:38:57 -03:00
Andrey Nering
2607866c49
readme: document new syntax for synamic variables
2017-07-15 15:37:24 -03: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
d22b3b0d88
readme: document the task_checksum.txt file on releases
...
closes #44
2017-07-15 14:52:31 -03:00
Andrey Nering
5ece1d74f6
fix Taskvars.yml vars not available while interpolating vars
prop
...
closes #40
2017-07-15 14:40:58 -03:00
Andrey Nering
ac7ab42d94
Create CODE_OF_CONDUCT.md
2017-07-15 14:31:53 -03:00
Andrey Nering
38a3f538f5
add CONTRIBUTING.md
2017-07-15 14:27:45 -03:00
Andrey Nering
998935ea55
add --list (or -l) flag to print existing tasks
...
If an inexixtent task is given, the help also prints as before
Also fixing README documentation
Closes #51
2017-07-15 14:10:46 -03:00
Andrey Nering
e781ac2512
own Taskfile: add task "todo" to print TODOs in code
2017-07-15 13:58:03 -03:00
Andrey Nering
ef2695974d
os specific Taskvars file
...
Now it's possible to have Taskfile_windows.yml or Taskvars_linux.yml
(and others).
Asked in a comment in #46
2017-07-15 13:52:02 -03:00
Andrey Nering
b552cc2b12
yaml: use UnmarshalStrict instead on Unmarshal
...
https://github.com/go-yaml/yaml/pull/262
2017-07-15 13:36:22 -03:00
Andrey Nering
4ae9c2445d
update deps
2017-07-15 13:34:42 -03:00
Sindre Røkenes Myren
769e25f080
Consider task up-to-date on equal timestamps
...
Fixes issue #48 by considering a task up-to-date if the newest
file from sources and the oldest file from generates has
exactly the same time-stamp.
2017-07-12 18:18:26 +02:00
Sindre Røkenes Myren
86a23849e0
Allow absolute path in generates section
...
Fixes issue #47 by allowing absolute paths in a task's generates and
sources sections. Tests are added for the generates section only at this
time.
2017-07-12 18:14:34 +02:00
Andrey Nering
a586fef414
Merge pull request #43 from smyrman/issue-42
...
Bugfix: allow templating when calling deps
2017-07-09 20:02:39 -03:00
Sindre Myren
a548c63a92
Bugfix: allow templating when calling deps
...
Fixes issue #42 by allowing for template evaluatation on task override
variables when the task is launched as dependency.
2017-07-09 23:48:36 +02:00
Andrey Nering
5268df6bfd
only get variable map twice and implement vars template
...
ref #40
2017-07-08 16:00:17 -03:00
Andrey Nering
82e1c0f810
refactor: functions reorder (higher level first)
2017-07-08 15:13:27 -03:00
Andrey Nering
81b0ffb7f4
rename: readTaskvarsFile() -> readTaskvars()
2017-07-08 15:10:01 -03:00
Andrey Nering
0da130ee2c
refactor: simplify some controls
2017-07-08 15:08:44 -03:00
Andrey Nering
6e880c9027
refactor: don't need to run template on Executor.Dir
2017-07-08 15:01:45 -03:00
Andrey Nering
082fa321cb
rename 2 files
...
- read_taskfile.go -> taskfile.go
- variable_handling.go -> variables.go
2017-07-08 14:58:43 -03:00
Andrey Nering
ff1c49f111
refactor: better usage of bytes.Buffer type
2017-07-08 14:57:12 -03:00
Andrey Nering
50f592c540
refactor getVariables()
2017-07-08 14:48:37 -03:00
Andrey Nering
7a7f66dfdc
refactor: join task and vars parameters in a single Call struct
2017-07-08 14:34:17 -03:00
Andrey Nering
a1140aa62f
Merge branch 'cyclic-dep'
2017-07-08 13:36:45 -03:00
Andrey Nering
2dd3564da1
changed cyclic dep detection
...
since interpolation can be used, detection should be a execution time,
and not before
now, to prevent infinite execution, there's a miximum of 100 calls per
task
closes #37
2017-07-08 13:33:55 -03:00
Andrey Nering
fb4b0a187e
Merge branch 'issue-37-cyclic-dep'
2017-07-08 10:26:18 -03:00
Andrey Nering
ac48ee066e
fix panic for invalid task in cyclic dep detection
...
resolves partly #37
2017-07-08 10:25:15 -03:00
Andrey Nering
06031efc09
cyclic: refactor to return error instead
2017-07-08 10:13:56 -03:00
Andrey Nering
9bea80b862
Merge pull request #41 from zbindenren/master
...
better error output for dynamic variables in Taskvars.yml
2017-07-07 07:01:21 -03:00
Rene Zbinden
92ecb1c7ec
better error output for dynamic variables in Taskvars.yml
2017-07-07 08:33:56 +02:00
Andrey Nering
645f77b849
Merge pull request #39 from smyrman/issue-38
...
Allow template evaluation when calling a task with vars
2017-07-06 21:30:47 -03:00
Sindre Røkenes Myren
2f9381065d
Allow template evaluation in parameters
...
When passing variables to a sub-task, allow template evaluation
within the passed-on variables.
2017-07-07 00:47:56 +02:00
Sindre Røkenes Myren
774ef61c2f
Update usage text slightly
2017-07-06 18:40:01 +02:00
Andrey Nering
dd2c66d2e1
v1.4.0
2017-07-05 21:32:30 -03:00
Andrey Nering
0deb2d78fb
improve README documentation
2017-07-05 21:31:41 -03:00
Andrey Nering
fdd7e7f2a8
add own Taskfile.yml file
2017-07-05 21:06:12 -03:00
Andrey Nering
ad1a440576
cache dymanic variables
2017-07-05 21:03:59 -03:00
Andrey Nering
222b5cb587
add verbose mode (-v flag)
2017-07-05 20:56:31 -03:00
Andrey Nering
a1d1f73fe7
update dependencies
2017-07-05 20:46:05 -03:00
Andrey Nering
e7f9ace559
rename goreleaser.yml to .goreleaser.yml
2017-07-05 20:39:19 -03:00