1
0
mirror of https://github.com/go-task/task.git synced 2025-01-26 05:27:15 +02:00

Merge branch 'master' into v3

This commit is contained in:
Andrey Nering 2019-12-07 22:04:16 -03:00
commit 15338ecb18
7 changed files with 24 additions and 5 deletions

View File

@ -7,7 +7,6 @@ insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = tab
indent_size = 8
[*.{md,yml,yaml,json,toml,htm,html}]
indent_style = space

View File

@ -34,13 +34,15 @@
commands are green, errors are red, etc
([#207](https://github.com/go-task/task/pull/207)).
## Unreleased
## v2.8.0 - 2019-12-07
- Add `--parallel` flag (alias `-p`) to run tasks given by the command line in
parallel
([#266](https://github.com/go-task/task/pull/266)).
- Fixed bug where calling the `task` CLI only informing global vars would not
execute the `default` task.
- Add hability to silent all tasks by adding `silent: true` a the root of the
Taskfile.
## v2.7.1 - 2019-11-10

View File

@ -1,5 +1,7 @@
version: '3'
# silent: true
includes:
docs: ./docs

View File

@ -28,7 +28,7 @@ officially supported. On Linux, only `Taskfile.yml` will work, though.
- `version:`
- `includes:`
- Configuration ones, like `output:` and `expansions:`
- Configuration ones, like `output:`, `expansions:` or `silent:`
- `vars:`
- `env:`
- `tasks:`

View File

@ -699,7 +699,7 @@ With silent mode on, the below will be print instead:
Print something
```
There's three ways to enable silent mode:
There are four ways to enable silent mode:
* At command level:
@ -725,6 +725,19 @@ tasks:
silent: true
```
* Globally at Taskfile level:
```yaml
version: '2'
silent: true
tasks:
echo:
cmds:
- echo "Print something"
```
* Or globally with `--silent` or `-s` flag
If you want to suppress STDOUT instead, just redirect a command to `/dev/null`:

View File

@ -10,6 +10,7 @@ type Taskfile struct {
Vars Vars
Env Vars
Tasks Tasks
Silent bool
}
// UnmarshalYAML implements yaml.Unmarshaler interface
@ -23,6 +24,7 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
Vars Vars
Env Vars
Tasks Tasks
Silent bool
}
if err := unmarshal(&taskfile); err != nil {
return err
@ -35,6 +37,7 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
tf.Vars = taskfile.Vars
tf.Env = taskfile.Env
tf.Tasks = taskfile.Tasks
tf.Silent = taskfile.Silent
if tf.Expansions <= 0 {
tf.Expansions = 2
}

View File

@ -316,7 +316,7 @@ func (e *Executor) runCommand(ctx context.Context, t *taskfile.Task, call taskfi
}
return nil
case cmd.Cmd != "":
if e.Verbose || (!cmd.Silent && !t.Silent && !e.Silent) {
if e.Verbose || (!cmd.Silent && !t.Silent && !e.Taskfile.Silent && !e.Silent) {
e.Logger.Errf(logger.Green, "task: %s", cmd.Cmd)
}