87a200e42c
Extract some functionality to its own packages
...
Like variable and template handling, and logging
2018-02-17 16:12:41 -02:00
152fc0ad38
Move all structs related to Taskfile to its own package
2018-02-17 14:22:18 -02:00
134c6b79c4
Add Taskfile struct and start implementing new format
...
Updates #54 , #66 and #77
2017-12-29 18:46:15 -02:00
71e7cd5808
listening for SIGINT and SIGTERM
...
closes #75
2017-11-19 18:33:57 -02:00
33b167215d
move some packages to the "internal" directory
...
- this makes it impossible to import these packages outside Task
- as a side effect, it makes the root directory cleaner
2017-10-15 17:58:21 -02:00
abb19dfbf8
print logs to stderr instead of stdout
...
also, don't print up-to-date status when the --silent flag was given
closes #68
2017-09-30 14:56:35 -03:00
48bf09da21
remove deprecated set
keyword
2017-09-17 11:24:30 -03:00
c295a1998a
add checksum based status check, alternative to timestamp based
2017-09-17 11:06:47 -03:00
f3097845b4
allow assigning variables to tasks at run time via CLI
...
using a similar syntax than setting env variables to command in bash,
but used right after the task:
```bash
task print MESSAGE=Hello!
```
closes #33
2017-09-07 13:57:06 -03:00
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
72bfd94329
Fixes env: remove square braces and evaluate shell ( #62 )
...
Fixes bug #61 , and makes `env` work more similar to `vars` by allowing
dynamic shell values to be evaluated as part of `CompiledTask`.
2017-08-16 08:04:58 -03:00
e765b7a9c4
do not check for maximum call if is watch
2017-08-05 13:26:30 -03:00
c210e34ce3
watch: switch to watcher as waych lib and few fixes
...
watcher whould be more consistent across differente OSes
2017-08-05 11:50:39 -03:00
f54dde4f78
func isUpToDate should be bound to Task struct
2017-07-30 19:45:59 -03:00
70ef9fbcfe
rename func: ReplaceVariables -> CompiledTask
2017-07-30 19:34:28 -03:00
09e84c2583
always echo command if is verbose mode
2017-07-30 19:21:06 -03:00
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
d0b37df615
add silent mode to disable echoing of commands
2017-07-19 20:20:24 -03:00
dc6cb68327
rename file.go to status.go, and move related code there
2017-07-16 16:15:29 -03:00
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
968a29d869
deduplicate conversion from dep and cmd to call
2017-07-15 15:46:53 -03:00
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
5ece1d74f6
fix Taskvars.yml vars not available while interpolating vars
prop
...
closes #40
2017-07-15 14:40:58 -03:00
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
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
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
5268df6bfd
only get variable map twice and implement vars template
...
ref #40
2017-07-08 16:00:17 -03:00
0da130ee2c
refactor: simplify some controls
2017-07-08 15:08:44 -03:00
6e880c9027
refactor: don't need to run template on Executor.Dir
2017-07-08 15:01:45 -03:00
ff1c49f111
refactor: better usage of bytes.Buffer type
2017-07-08 14:57:12 -03:00
7a7f66dfdc
refactor: join task and vars parameters in a single Call struct
2017-07-08 14:34:17 -03:00
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
06031efc09
cyclic: refactor to return error instead
2017-07-08 10:13:56 -03:00
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
ad1a440576
cache dymanic variables
2017-07-05 21:03:59 -03:00
222b5cb587
add verbose mode (-v flag)
2017-07-05 20:56:31 -03:00
06d80e92eb
rename Cmd.Params to Cmd.Vars
2017-07-05 20:07:27 -03:00
b8fe8d465e
refactor: onyl read Taskvars file once
2017-07-03 21:16:10 -03:00
196d3cb13d
add custom Cmd and Dep types
2017-07-03 21:04:38 -03:00
2ace0defd0
Print command, also when "set:" is specified
...
Always prints the command, even when the
set-keyword is used within the task.
2017-07-03 15:05:19 +02:00
9ba44f3e6e
allow custom Stdin, Stdout and Stderr while running as a lib
2017-07-01 15:05:51 -03:00
81e0f170ef
accept setting dir of execution and improve tests
...
One test is not yet migrated. First we should have specific
Stdin, Stdout and Stderr for executor.
2017-06-24 20:09:05 -03:00
540e458b16
refactor isUpToDate()
2017-06-04 16:45:34 -03:00
b530cba0d5
Abstract Tasks type
2017-06-04 16:41:38 -03:00
f98bf6c4b1
refactor: Create executor struct to get rid of global variables
...
Maybe eventually help on #17
2017-06-04 16:02:04 -03:00
2615000609
Add --init flag to create a new Taskfile
2017-05-17 15:38:46 -03:00
83f1b213fa
Use context on status commands
2017-05-17 14:53:39 -03:00
2a2dfce137
Add status option to prevent task from running
...
Closes #27
2017-05-17 14:37:16 -03:00
b269c6e162
Allow interpolation on "generates" and "sources" attributes
...
Closes #26
2017-04-30 19:32:33 -03:00
8b76911675
Small refactor of variables replacing
2017-04-30 19:13:21 -03:00