From 00a5cc654a03f5f102f0d15c4f23d72f49d5572a Mon Sep 17 00:00:00 2001 From: CityFun <31820853+zhengkunwang223@users.noreply.github.com> Date: Tue, 17 Jun 2025 16:04:02 +0800 Subject: [PATCH] fix: fix issue with run script with no return (#9137) --- agent/utils/cmd/cmdx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/utils/cmd/cmdx.go b/agent/utils/cmd/cmdx.go index 276a76651..5ff3e9064 100644 --- a/agent/utils/cmd/cmdx.go +++ b/agent/utils/cmd/cmdx.go @@ -120,9 +120,9 @@ func (c *CommandHelper) run(name string, arg ...string) (string, error) { cmd.Stdout = file cmd.Stderr = file } else if len(c.scriptPath) != 0 { + cmd = exec.Command("bash", c.scriptPath) cmd.Stdout = &stdout cmd.Stderr = &stderr - cmd = exec.Command("bash", c.scriptPath) } else { cmd.Stdout = &stdout cmd.Stderr = &stderr