feat: aliases

feat: add aliases to --list and --list-all flags

feat: add aliases to --summary

feat: enable aliases for included tasks

tests: added alias unit tests
This commit is contained in:
Pete Davison
2022-10-01 22:39:44 +00:00
parent d2061ec898
commit 376a6182eb
15 changed files with 183 additions and 21 deletions

View File

@@ -55,6 +55,9 @@ func Merge(t1, t2 *Taskfile, internal bool, namespaces ...string) error {
cmd.Task = taskNameWithNamespace(cmd.Task, namespaces...)
}
}
for i, alias := range v.Aliases {
v.Aliases[i] = taskNameWithNamespace(alias, namespaces...)
}
}
return nil

View File

@@ -11,6 +11,7 @@ type Task struct {
Label string
Desc string
Summary string
Aliases []string
Sources []string
Generates []string
Status []string
@@ -56,6 +57,7 @@ func (t *Task) UnmarshalYAML(unmarshal func(interface{}) error) error {
Label string
Desc string
Summary string
Aliases []string
Sources []string
Generates []string
Status []string
@@ -78,6 +80,7 @@ func (t *Task) UnmarshalYAML(unmarshal func(interface{}) error) error {
t.Deps = task.Deps
t.Label = task.Label
t.Desc = task.Desc
t.Aliases = task.Aliases
t.Summary = task.Summary
t.Sources = task.Sources
t.Generates = task.Generates