support shell cmd split

This commit is contained in:
lzh
2025-07-07 09:20:15 +08:00
parent a1ab697848
commit c54e81321e
4 changed files with 8 additions and 3 deletions

View File

@@ -4,7 +4,8 @@ import (
"bufio"
"io"
"os/exec"
"strings"
"github.com/google/shlex"
"github.com/lzh-1625/go_process_manager/config"
"github.com/lzh-1625/go_process_manager/internal/app/constants"
@@ -133,7 +134,7 @@ func (p *ProcessStd) Read() string {
func NewProcessStd(pconfig model.Process) *ProcessBase {
p := ProcessBase{
Name: pconfig.Name,
StartCommand: strings.Split(pconfig.Cmd, " "),
StartCommand: utils.UnwarpIgnore(shlex.Split(pconfig.Cmd)),
WorkDir: pconfig.Cwd,
}
processStd := ProcessStd{