From 9ba49fa454c58352268ae55ba9dbb25f41d4f3f2 Mon Sep 17 00:00:00 2001 From: HaiLaz <739476267@qq.com> Date: Mon, 6 Feb 2023 20:35:11 +0800 Subject: [PATCH] fix issue in `gf run` failed with arguments passed in windows platform (#2414) --- cmd/gf/internal/cmd/cmd_run.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/gf/internal/cmd/cmd_run.go b/cmd/gf/internal/cmd/cmd_run.go index 2b766db40..2bc2752cc 100644 --- a/cmd/gf/internal/cmd/cmd_run.go +++ b/cmd/gf/internal/cmd/cmd_run.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "runtime" + "strings" "github.com/gogf/gf/v2/container/gtype" "github.com/gogf/gf/v2/frame/g" @@ -154,7 +155,7 @@ func (app *cRunApp) Run(ctx context.Context) { if runtime.GOOS == "windows" { // Special handling for windows platform. // DO NOT USE "cmd /c" command. - process = gproc.NewProcess(runCommand, nil) + process = gproc.NewProcess(outputPath, strings.Fields(app.Args)) } else { process = gproc.NewProcessCmd(runCommand, nil) }