args가 빈 값으로 들어왔을 때 처리
This commit is contained in:
@ -168,6 +168,9 @@ func prepareProcessLaunch(req *shared.StartProcessRequest) *procmeta {
|
||||
re := regexp.MustCompile(`[^\s"']+|"([^"]*)"|'([^']*)`)
|
||||
args := re.FindAllString(req.Args, -1)
|
||||
|
||||
if len(args) == 0 {
|
||||
return nil
|
||||
}
|
||||
verpath := path.Join(req.Name, req.Version)
|
||||
fi, err := os.Stat(verpath)
|
||||
|
||||
@ -315,6 +318,8 @@ func (hc *houstonClient) launch(meta *procmeta) error {
|
||||
return err
|
||||
}
|
||||
|
||||
var errPrepareprocessLaunchFailed = errors.New("prepareProcessLaunch failed")
|
||||
|
||||
func (hc *houstonClient) startChildProcess(req *shared.StartProcessRequest) error {
|
||||
logger.Println("startChildProcess :", *req)
|
||||
if req.Version == "latest" {
|
||||
@ -328,6 +333,9 @@ func (hc *houstonClient) startChildProcess(req *shared.StartProcessRequest) erro
|
||||
}
|
||||
|
||||
meta := prepareProcessLaunch(req)
|
||||
if meta == nil {
|
||||
return errPrepareprocessLaunchFailed
|
||||
}
|
||||
if err := hc.launch(meta); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user