diff --git a/coverage-badge.svg b/coverage-badge.svg index 82fd6fa..513b8cd 100644 --- a/coverage-badge.svg +++ b/coverage-badge.svg @@ -11,7 +11,7 @@ coverage coverage - 18.2% - 18.2% + 18.3% + 18.3% diff --git a/internal/shutils/decoder/decoder.go b/internal/shutils/decoder/decoder.go index 906133d..629e2a7 100644 --- a/internal/shutils/decoder/decoder.go +++ b/internal/shutils/decoder/decoder.go @@ -169,21 +169,7 @@ type ScriptFunc func(ctx context.Context, opts ...interp.RunnerOption) error // GetFunc returns a function corresponding to a bash function // with the given name func (d *Decoder) GetFunc(name string) (ScriptFunc, bool) { - fn := d.getFunc(name) - if fn == nil { - return nil, false - } - - return func(ctx context.Context, opts ...interp.RunnerOption) error { - sub := d.Runner.Subshell() - for _, opt := range opts { - err := opt(sub) - if err != nil { - return err - } - } - return sub.Run(ctx, fn) - }, true + return d.GetFuncP(name, nil) } type PrepareFunc func(context.Context, *interp.Runner) error