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

@@ -6,6 +6,7 @@ import (
"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"
"github.com/lzh-1625/go_process_manager/internal/app/model"
@@ -133,7 +134,7 @@ func (p *ProcessPty) doOnInit() {
func NewProcessPty(pconfig model.Process) *ProcessBase {
p := ProcessBase{
Name: pconfig.Name,
StartCommand: strings.Split(pconfig.Cmd, " "),
StartCommand: utils.UnwarpIgnore(shlex.Split(pconfig.Cmd)),
WorkDir: pconfig.Cwd,
}
processPty := ProcessPty{