1
0
mirror of https://github.com/go-task/task.git synced 2025-11-25 22:32:55 +02:00

Merge branch 'master' into v3

This commit is contained in:
Andrey Nering
2019-11-24 21:02:33 -03:00
163 changed files with 4675 additions and 1305 deletions

13
task.go
View File

@@ -40,6 +40,7 @@ type Executor struct {
Silent bool
Dry bool
Summary bool
Parallel bool
Color bool
Stdin io.Reader
@@ -77,12 +78,18 @@ func (e *Executor) Run(ctx context.Context, calls ...taskfile.Call) error {
return e.watchTasks(calls...)
}
g, ctx := errgroup.WithContext(ctx)
for _, c := range calls {
if err := e.RunTask(ctx, c); err != nil {
return err
c := c
if e.Parallel {
g.Go(func() error { return e.RunTask(ctx, c) })
} else {
if err := e.RunTask(ctx, c); err != nil {
return err
}
}
}
return nil
return g.Wait()
}
// Setup setups Executor's internal state