1
0
mirror of https://github.com/go-task/task.git synced 2025-06-17 00:17:51 +02:00
Commit Graph

134 Commits

Author SHA1 Message Date
902f0d3ac4 Don't persist new checksum on the disk if dry mode is enabled
Fixes #166
2019-02-09 10:44:35 -02:00
713ecd35f6 Pass context as an argument 2019-02-09 10:16:13 -02:00
27b35157cd Indentation fix 2019-02-09 10:15:38 -02:00
kj
a026d72924 Add execute output style options 2019-02-05 15:42:57 +09:00
aac6c5a1c7 Add hability to globally set environment variables
Closes #138
2019-01-02 12:06:12 -02:00
3cbc89769d Re-write import paths to v2 2018-11-04 21:23:35 -02:00
5d9de14ca3 Increment the current Taskfile version to 2.2 2018-10-13 18:25:40 -03:00
8bdf5c554d Fixes after updating mvdan.cc/sh 2018-09-01 11:02:23 -03:00
491da0ceb9 "ignore_error" is only available on version >= 2.1 2018-08-19 15:46:07 -03:00
feaf70922d Allow ignore_error at task level 2018-08-05 12:53:42 -03:00
c70343a5bc Handle ignore_error one level up on the code 2018-08-05 12:40:11 -03:00
550c116aea Merge branch 'master' into master 2018-08-05 11:32:07 -03:00
a5f31a4280 Dry run small code style changes 2018-08-05 11:28:02 -03:00
90a5f17f58 Merge branch 'master' into master 2018-08-01 10:47:25 +02:00
108cb91d95 IgnoreError
* Document ignore_error
* ignore_error only for commands
2018-08-01 10:44:53 +02:00
1c7ca94d49 Implemented dry run mode
Added a --dry-run flag that compiles and steps through each task, but does not execute them. The commands that would have been run are printed. See #125.
2018-07-29 00:39:25 +01:00
9f294b4d10 Refactor and move logic of reading Taskfiles to its own package
Idea to making things easier to start implementing #98
2018-07-22 16:10:20 -03:00
05600601ff add ignoreError option 2018-07-10 10:44:58 +02:00
09eab770a7 Skip empty commands
Fixes #120
2018-06-24 10:29:46 -03:00
a407b0a8eb First step implementing "prefixed" output option
Ref #104
2018-04-22 15:41:53 -03:00
051ff35878 Add "output" option to Taskfile to control how stuff are printed to stdout/stderr
First step for #104
2018-04-15 14:37:44 -03:00
8b3c34c308 Add "output" options to the Taskfile
Also, fix handling of Taskfile by making the version an instance of
`semver.Constraints` instead of `semver.Version`. This makes the version
works as described on TASKFILE_VERSIONS.md document, i.e. version "2" will
include "2.x" features but version "2.0" not.
2018-04-15 11:11:07 -03:00
120d0be84c Fixes panic on task --list
Fixes #99
2018-03-11 14:39:40 -03:00
c1ae36866e Remove warning for version 2 2018-03-04 16:27:16 -03:00
51998f706f Allow customizable number of expansions
Updates #66
2018-03-04 15:50:03 -03:00
1a3df08aca Allow global variables in the Taskfile
Closes #66
2018-03-04 15:39:14 -03:00
12c0d18932 Move setting of default version to "taskfile" package 2018-03-03 18:56:15 -03:00
2d4ca37226 Use semver for Taskfile versions 2018-03-03 18:54:42 -03:00
19d4b8b7f7 Add warning about Taskfile version 2 until v2.0.0 release 2018-02-18 10:04:17 -03:00
3556942516 Improve nested variables support
Closes #76 #89 #77 #83
2018-02-18 09:50:39 -03:00
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