1
0
mirror of https://github.com/go-task/task.git synced 2025-03-17 21:08:01 +02:00

Use context on status commands

This commit is contained in:
Andrey Nering 2017-05-17 14:53:39 -03:00
parent c9a64fedd7
commit 83f1b213fa

View File

@ -97,7 +97,7 @@ func RunTask(ctx context.Context, name string) error {
}
if !Force {
upToDate, err := t.isUpToDate()
upToDate, err := t.isUpToDate(ctx)
if err != nil {
return err
}
@ -140,7 +140,7 @@ func (t *Task) runDeps(ctx context.Context) error {
return nil
}
func (t *Task) isUpToDate() (bool, error) {
func (t *Task) isUpToDate(ctx context.Context) (bool, error) {
if len(t.Status) > 0 {
environ, err := t.getEnviron()
if err != nil {
@ -149,6 +149,7 @@ func (t *Task) isUpToDate() (bool, error) {
for _, s := range t.Status {
err = execext.RunCommand(&execext.RunCommandOptions{
Context: ctx,
Command: s,
Dir: t.Dir,
Env: environ,