fix: run once in shared dependencies (#1655)

* fix: run once in shared dependencies

* feat: add test
This commit is contained in:
Pete Davison
2024-06-28 16:50:02 +01:00
committed by GitHub
parent a9ff58d0fe
commit 3aaa3223a0
13 changed files with 128 additions and 37 deletions

View File

@@ -4,15 +4,12 @@ import (
"fmt"
"github.com/go-task/task/v3/internal/hash"
"github.com/go-task/task/v3/internal/slicesext"
"github.com/go-task/task/v3/taskfile/ast"
)
func (e *Executor) GetHash(t *ast.Task) (string, error) {
r := t.Run
if r == "" {
r = e.Taskfile.Run
}
r := slicesext.FirstNonZero(t.Run, e.Taskfile.Run)
var h hash.HashFunc
switch r {
case "always":