diff --git a/exec.go b/exec.go index cf1b299..9055fcf 100644 --- a/exec.go +++ b/exec.go @@ -269,8 +269,6 @@ func execCommand(cmd string, strms *streams) (io.Writer, io.Writer, error) { return nil, nil, err } - runner, _ := interp.New() - if strms == nil { strms = &streams{} } diff --git a/main.go b/main.go index fd511a9..41d1d35 100644 --- a/main.go +++ b/main.go @@ -21,6 +21,7 @@ import ( "github.com/pborman/getopt" "github.com/maxlandon/readline" "golang.org/x/term" + "mvdan.cc/sh/v3/interp" ) var ( @@ -37,9 +38,11 @@ var ( cmds *commander.Commander defaultConfPath string defaultHistPath string + runner *interp.Runner ) func main() { + runner, _ = interp.New() curuser, _ = user.Current() homedir := curuser.HomeDir confDir, _ = os.UserConfigDir()