mirror of
https://github.com/go-task/task.git
synced 2025-08-10 22:42:19 +02:00
Fix typos per review
This commit is contained in:
@@ -346,7 +346,7 @@ the tasks are not up-to-date.
|
|||||||
|
|
||||||
If you need a certain set of conditions to be _true_ you can use the
|
If you need a certain set of conditions to be _true_ you can use the
|
||||||
`preconditions` stanza. `preconditions` are very similar to `status`
|
`preconditions` stanza. `preconditions` are very similar to `status`
|
||||||
lines except they support `sh` expansion and they SHOULD all return 0
|
lines except they support `sh` expansion and they SHOULD all return 0.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: '2'
|
version: '2'
|
||||||
@@ -373,7 +373,7 @@ executed with a failing precondition will not run unless `--force` is
|
|||||||
given.
|
given.
|
||||||
|
|
||||||
Unlike `status` which will skip a task if it is up to date, and continue
|
Unlike `status` which will skip a task if it is up to date, and continue
|
||||||
executing tasks that depenend on it a `precondition` will fail a task, along
|
executing tasks that depend on it, a `precondition` will fail a task, along
|
||||||
with any other tasks that depend on it.
|
with any other tasks that depend on it.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
@@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
// ErrCantUnmarshalPrecondition is returned for invalid precond YAML.
|
// ErrCantUnmarshalPrecondition is returned for invalid precond YAML.
|
||||||
ErrCantUnmarshalPrecondition = errors.New("task: can't unmarshal precondition value")
|
ErrCantUnmarshalPrecondition = errors.New("task: Can't unmarshal precondition value")
|
||||||
)
|
)
|
||||||
|
|
||||||
// Precondition represents a precondition necessary for a task to run
|
// Precondition represents a precondition necessary for a task to run
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
// Package task provides ...
|
|
||||||
package task
|
package task
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -23,7 +22,7 @@ func (e *Executor) areTaskPreconditionsMet(ctx context.Context, t *taskfile.Task
|
|||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e.Logger.Outf(p.Msg)
|
e.Logger.Outf("task: %s", p.Msg)
|
||||||
return false, ErrPreconditionFailed
|
return false, ErrPreconditionFailed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
task.go
2
task.go
@@ -233,7 +233,6 @@ func (e *Executor) runDeps(ctx context.Context, t *taskfile.Task) error {
|
|||||||
g.Go(func() error {
|
g.Go(func() error {
|
||||||
err := e.RunTask(ctx, taskfile.Call{Task: d.Task, Vars: d.Vars})
|
err := e.RunTask(ctx, taskfile.Call{Task: d.Task, Vars: d.Vars})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e.Logger.Errf("%s", err)
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@@ -250,7 +249,6 @@ func (e *Executor) runCommand(ctx context.Context, t *taskfile.Task, call taskfi
|
|||||||
case cmd.Task != "":
|
case cmd.Task != "":
|
||||||
err := e.RunTask(ctx, taskfile.Call{Task: cmd.Task, Vars: cmd.Vars})
|
err := e.RunTask(ctx, taskfile.Call{Task: cmd.Task, Vars: cmd.Vars})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e.Logger.Errf("%s", err)
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@@ -281,7 +281,6 @@ func TestPrecondition(t *testing.T) {
|
|||||||
Dir: dir,
|
Dir: dir,
|
||||||
Stdout: &buff,
|
Stdout: &buff,
|
||||||
Stderr: &buff,
|
Stderr: &buff,
|
||||||
Silent: false,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// A precondition that has been met
|
// A precondition that has been met
|
||||||
|
Reference in New Issue
Block a user