1
0
mirror of https://github.com/go-task/task.git synced 2025-11-23 22:24:45 +02:00

feat: improve fingerprint, run and output with wildcard (#1808)

This commit is contained in:
Valentin Maerten
2025-09-11 19:33:53 +02:00
committed by GitHub
parent 43cb64e6cc
commit 48039be12c
7 changed files with 51 additions and 4 deletions

View File

@@ -44,9 +44,14 @@ func (e *Executor) compiledTask(call *Call, evaluateShVars bool) (*ast.Task, err
if err != nil {
return nil, err
}
fullName := origTask.Task
if matches, exists := vars.Get("MATCH"); exists {
for _, match := range matches.Value.([]string) {
fullName = strings.Replace(fullName, "*", match, 1)
}
}
cache := &templater.Cache{Vars: vars}
new := ast.Task{
Task: origTask.Task,
Label: templater.Replace(origTask.Label, cache),
@@ -76,6 +81,7 @@ func (e *Executor) compiledTask(call *Call, evaluateShVars bool) (*ast.Task, err
Requires: origTask.Requires,
Watch: origTask.Watch,
Namespace: origTask.Namespace,
FullName: fullName,
}
new.Dir, err = execext.ExpandLiteral(new.Dir)
if err != nil {