1
0
mirror of https://github.com/go-task/task.git synced 2025-11-25 22:32:55 +02:00

feat(task): tasks can be internal (not accessible from cli)

This commit is contained in:
Pete Davison
2022-07-22 02:15:35 +00:00
parent c172185a24
commit 6f8f1f1409
7 changed files with 78 additions and 3 deletions

View File

@@ -64,11 +64,16 @@ type Executor struct {
func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
// check if given tasks exist
for _, c := range calls {
if _, ok := e.Taskfile.Tasks[c.Task]; !ok {
t, ok := e.Taskfile.Tasks[c.Task]
if !ok {
// FIXME: move to the main package
e.ListTasksWithDesc()
return &taskNotFoundError{taskName: c.Task}
}
if t.Internal {
e.ListTasksWithDesc()
return &taskInternalError{taskName: c.Task}
}
}
if e.Summary {