Skip to content

Commit c5d2092

Browse files
committed
use slices.concat
1 parent 49af480 commit c5d2092

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

precondition.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package task
22

33
import (
44
"context"
5+
"slices"
56

67
"github.com/go-task/task/v3/errors"
78
"github.com/go-task/task/v3/internal/env"
@@ -14,7 +15,7 @@ import (
1415
var ErrPreconditionFailed = errors.New("task: precondition not met")
1516

1617
func (e *Executor) areTaskPreconditionsMet(ctx context.Context, t *ast.Task) (bool, error) {
17-
for _, p := range append(t.Preconditions, e.Taskfile.Preconditions.Preconditions...) {
18+
for _, p := range slices.Concat(e.Taskfile.Preconditions.Preconditions, t.Preconditions) {
1819
err := execext.RunCommand(ctx, &execext.RunCommandOptions{
1920
Command: p.Sh,
2021
Dir: t.Dir,

0 commit comments

Comments
 (0)