mirror of
https://github.com/go-task/task.git
synced 2025-05-21 22:43:13 +02:00
Cleaning up the run code
This commit is contained in:
parent
bbe1d8b52e
commit
2da38a5bdc
@ -456,12 +456,16 @@ tasks:
|
|||||||
### Limiting when tasks run
|
### Limiting when tasks run
|
||||||
|
|
||||||
If a task executed by multiple `cmds` or multiple `deps` you can limit
|
If a task executed by multiple `cmds` or multiple `deps` you can limit
|
||||||
how many times it is executed each invocation of the `task` command using `run`. `run` can also be set at the root of the taskfile to change the behavior of all the tasks unless explicitly overridden
|
how many times it is executed using `run`. `run` can also be set at the root
|
||||||
|
of the Taskfile to change the behavior of all the tasks unless explicitly
|
||||||
|
overridden
|
||||||
|
|
||||||
Supported values for `run`
|
Supported values for `run`
|
||||||
* `always` (default) always attempt to invoke the task regardless of the number of previous executions
|
* `always` (default) always attempt to invoke the task regardless of the
|
||||||
* `once` only invoke this task once regardless of the number of times referred to
|
number of previous executions
|
||||||
* `when_changed` only invokes the task once for a set of variables passed into the task
|
* `once` only invoke this task once regardless of the number of references
|
||||||
|
* `when_changed` only invokes the task once for each unique set of variables
|
||||||
|
passed into the task
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: '3'
|
version: '3'
|
||||||
|
@ -3,8 +3,9 @@ package hash
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/go-task/task/v3/taskfile"
|
|
||||||
"github.com/mitchellh/hashstructure/v2"
|
"github.com/mitchellh/hashstructure/v2"
|
||||||
|
|
||||||
|
"github.com/go-task/task/v3/taskfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
type HashFunc func(*taskfile.Task) (string, error)
|
type HashFunc func(*taskfile.Task) (string, error)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user