mirror of
https://github.com/go-task/task.git
synced 2025-04-21 12:17:07 +02:00
fix: handle errors when sh is used in Taskfiles with the any variables experiment enabled
This commit is contained in:
parent
1eeb7d5cf9
commit
7feceeae87
4
task.go
4
task.go
@ -478,8 +478,8 @@ func (e *Executor) GetTaskList(filters ...FilterFunc) ([]*taskfile.Task, error)
|
|||||||
task := tasks[idx]
|
task := tasks[idx]
|
||||||
g.Go(func() error {
|
g.Go(func() error {
|
||||||
compiledTask, err := e.FastCompiledTask(taskfile.Call{Task: task.Task})
|
compiledTask, err := e.FastCompiledTask(taskfile.Call{Task: task.Task})
|
||||||
if err == nil {
|
if err != nil {
|
||||||
task = compiledTask
|
return err
|
||||||
}
|
}
|
||||||
tasks[idx] = compiledTask
|
tasks[idx] = compiledTask
|
||||||
return nil
|
return nil
|
||||||
|
@ -169,6 +169,11 @@ func (e *Executor) compiledTask(call taskfile.Call, evaluateShVars bool) (*taskf
|
|||||||
}
|
}
|
||||||
case []any:
|
case []any:
|
||||||
list = value
|
list = value
|
||||||
|
case map[string]any:
|
||||||
|
return &taskfile.Task{}, errors.TaskfileInvalidError{
|
||||||
|
URI: origTask.Location.Taskfile,
|
||||||
|
Err: errors.New("sh is not supported with the 'Any Variables' experiment enabled.\nSee https://taskfile.dev/experiments/any-variables for more information."),
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return nil, errors.TaskfileInvalidError{
|
return nil, errors.TaskfileInvalidError{
|
||||||
URI: origTask.Location.Taskfile,
|
URI: origTask.Location.Taskfile,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user