mirror of
https://github.com/go-task/task.git
synced 2025-02-05 13:25:14 +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 (
|
var (
|
||||||
// ErrNilOptions is returned when a nil options is given
|
// ErrNilOptions is returned when a nil options is given
|
||||||
ErrNilOptions = errors.New("execext: nil options given")
|
ErrNilOptions = errors.New("execext: nil options given")
|
||||||
|
|
||||||
parser = syntax.NewParser()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// RunCommand runs a shell command
|
// RunCommand runs a shell command
|
||||||
@ -34,7 +32,7 @@ func RunCommand(opts *RunCommandOptions) error {
|
|||||||
return ErrNilOptions
|
return ErrNilOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
p, err := parser.Parse(strings.NewReader(opts.Command), "")
|
p, err := syntax.NewParser().Parse(strings.NewReader(opts.Command), "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user