Merge branch 'internal-tasks' of https://github.com/pd93/task into pd93-internal-tasks

This commit is contained in:
Andrey Nering
2022-09-17 12:59:19 -03:00
13 changed files with 190 additions and 7 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 {