1
0
mirror of https://github.com/go-task/task.git synced 2025-04-02 22:15:30 +02:00

use slices.concat

This commit is contained in:
Valentin Maerten 2025-02-23 12:19:24 +01:00
parent c676b20385
commit b72d1bbcfa
No known key found for this signature in database
GPG Key ID: 2F8E54DDF815C341

View File

@ -2,6 +2,7 @@ package task
import (
"context"
"slices"
"github.com/go-task/task/v3/errors"
"github.com/go-task/task/v3/internal/env"
@ -14,7 +15,7 @@ import (
var ErrPreconditionFailed = errors.New("task: precondition not met")
func (e *Executor) areTaskPreconditionsMet(ctx context.Context, t *ast.Task) (bool, error) {
for _, p := range append(t.Preconditions, e.Taskfile.Preconditions.Preconditions...) {
for _, p := range slices.Concat(e.Taskfile.Preconditions.Preconditions, t.Preconditions) {
err := execext.RunCommand(ctx, &execext.RunCommandOptions{
Command: p.Sh,
Dir: t.Dir,