From 2da38a5bdc548d9eebde53f97acb2f2898c1819e Mon Sep 17 00:00:00 2001 From: Ross Hammermeister Date: Mon, 19 Jul 2021 21:10:28 -0600 Subject: [PATCH] Cleaning up the run code --- docs/usage.md | 12 ++++++++---- internal/hash/hash.go | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 3b94a23e..74dd3dee 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -456,12 +456,16 @@ tasks: ### Limiting when tasks run 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` - * `always` (default) always attempt to invoke the task regardless of the number of previous executions - * `once` only invoke this task once regardless of the number of times referred to - * `when_changed` only invokes the task once for a set of variables passed into the task + * `always` (default) always attempt to invoke the task regardless of the + number of previous executions + * `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 version: '3' diff --git a/internal/hash/hash.go b/internal/hash/hash.go index dd9799cd..5b3c5659 100644 --- a/internal/hash/hash.go +++ b/internal/hash/hash.go @@ -3,8 +3,9 @@ package hash import ( "fmt" - "github.com/go-task/task/v3/taskfile" "github.com/mitchellh/hashstructure/v2" + + "github.com/go-task/task/v3/taskfile" ) type HashFunc func(*taskfile.Task) (string, error)