mirror of
https://github.com/go-task/task.git
synced 2025-01-26 05:27:15 +02:00
Fix instantiation of parser
Seems that the parser cannot be reused. Some tests were ramdomly failing.
This commit is contained in:
parent
2615000609
commit
398a2c519c
@ -24,8 +24,6 @@ type RunCommandOptions struct {
|
||||
var (
|
||||
// ErrNilOptions is returned when a nil options is given
|
||||
ErrNilOptions = errors.New("execext: nil options given")
|
||||
|
||||
parser = syntax.NewParser()
|
||||
)
|
||||
|
||||
// RunCommand runs a shell command
|
||||
@ -34,7 +32,7 @@ func RunCommand(opts *RunCommandOptions) error {
|
||||
return ErrNilOptions
|
||||
}
|
||||
|
||||
p, err := parser.Parse(strings.NewReader(opts.Command), "")
|
||||
p, err := syntax.NewParser().Parse(strings.NewReader(opts.Command), "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user