mirror of
https://github.com/go-task/task.git
synced 2026-07-07 14:09:11 +00:00
Handle ignore_error one level up on the code
This commit is contained in:
@@ -13,14 +13,13 @@ import (
|
||||
|
||||
// RunCommandOptions is the options for the RunCommand func
|
||||
type RunCommandOptions struct {
|
||||
Context context.Context
|
||||
Command string
|
||||
Dir string
|
||||
Env []string
|
||||
Stdin io.Reader
|
||||
Stdout io.Writer
|
||||
Stderr io.Writer
|
||||
IgnoreErrorCode bool
|
||||
Context context.Context
|
||||
Command string
|
||||
Dir string
|
||||
Env []string
|
||||
Stdin io.Reader
|
||||
Stdout io.Writer
|
||||
Stderr io.Writer
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -63,12 +62,5 @@ func RunCommand(opts *RunCommandOptions) error {
|
||||
if err = r.Reset(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = r.Run(p); err != nil {
|
||||
if opts.IgnoreErrorCode {
|
||||
if _, ok := err.(interp.ExitCode); ok {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return err
|
||||
return r.Run(p)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user