From a89dd4448c781b71e704617c0af6af46af18dcca Mon Sep 17 00:00:00 2001 From: Joe Lim <50560759+joelim-work@users.noreply.github.com> Date: Sun, 18 Jun 2023 15:21:19 +1000 Subject: [PATCH] Fix shellopts bug --- os_windows.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/os_windows.go b/os_windows.go index 534e9bb2..edb85745 100644 --- a/os_windows.go +++ b/os_windows.go @@ -106,7 +106,8 @@ func shellCommand(s string, args []string) *exec.Cmd { for _, arg := range args { fmt.Fprintf(&builder, ` "%s"`, arg) } - cmdline := fmt.Sprintf(`%s %s %s "%s"`, gOpts.shell, gOpts.shellopts, gOpts.shellflag, builder.String()) + shellOpts := strings.Join(gOpts.shellopts, " ") + cmdline := fmt.Sprintf(`%s %s %s "%s"`, gOpts.shell, shellOpts, gOpts.shellflag, builder.String()) cmd := exec.Command(gOpts.shell) cmd.SysProcAttr = &windows.SysProcAttr{CmdLine: cmdline}