1
0
mirror of https://github.com/go-task/task.git synced 2025-11-06 09:09:13 +02:00

Allow calling a task of the root Taskfile from within an included Taskfile

Fixes #161
This commit is contained in:
Andrey Nering
2019-02-02 21:12:57 -02:00
parent 310394aa60
commit 1dec956e99
7 changed files with 41 additions and 0 deletions

View File

@@ -66,5 +66,8 @@ func Merge(t1, t2 *Taskfile, namespaces ...string) error {
}
func taskNameWithNamespace(taskName string, namespaces ...string) string {
if strings.HasPrefix(taskName, ":") {
return strings.TrimPrefix(taskName, ":")
}
return strings.Join(append(namespaces, taskName), NamespaceSeparator)
}