mirror of
https://github.com/go-task/task.git
synced 2025-06-15 00:15:10 +02:00
Add --json flag to be used by editor extensions (#936)
This commit is contained in:
4
task.go
4
task.go
@ -72,12 +72,10 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
|
||||
for _, call := range calls {
|
||||
task, err := e.GetTask(call)
|
||||
if err != nil {
|
||||
e.ListTasks(FilterOutInternal(), FilterOutNoDesc())
|
||||
return err
|
||||
}
|
||||
|
||||
if task.Internal {
|
||||
e.ListTasks(FilterOutInternal(), FilterOutNoDesc())
|
||||
return &taskInternalError{taskName: call.Task}
|
||||
}
|
||||
}
|
||||
@ -396,7 +394,7 @@ func (e *Executor) GetTaskList(filters ...FilterFunc) []*taskfile.Task {
|
||||
tasks = filter(tasks)
|
||||
}
|
||||
|
||||
// Sort the tasks
|
||||
// Sort the tasks.
|
||||
// Tasks that are not namespaced should be listed before tasks that are.
|
||||
// We detect this by searching for a ':' in the task name.
|
||||
sort.Slice(tasks, func(i, j int) bool {
|
||||
|
Reference in New Issue
Block a user