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:
7
task.go
7
task.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user