1
0
mirror of https://github.com/beego/bee.git synced 2025-06-21 04:50:18 +00:00

Merge pull request #537 from wilhelmguo/master

Support extra args to run application.
This commit is contained in:
astaxie
2018-07-21 22:27:53 +08:00
committed by GitHub
2 changed files with 10 additions and 1 deletions

View File

@ -206,7 +206,13 @@ func Start(appname string) {
cmd = exec.Command(appname)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Args = append([]string{appname}, config.Conf.CmdArgs...)
if runargs != "" {
r := regexp.MustCompile("'.+'|\".+\"|\\S+")
m := r.FindAllString(runargs, -1)
cmd.Args = append([]string{appname}, m...)
} else {
cmd.Args = append([]string{appname}, config.Conf.CmdArgs...)
}
cmd.Env = append(os.Environ(), config.Conf.Envs...)
go cmd.Run()