환경변수를 expand할 수 있음
This commit is contained in:
@ -183,7 +183,7 @@ func (hc *houstonClient) makeOperationQueryRequest() *protos.OperationQueryReque
|
||||
for _, child := range hc.childProcs {
|
||||
procs = append(procs, &protos.ProcessDescription{
|
||||
Name: child.name,
|
||||
Args: child.args,
|
||||
Args: child.cmd.Args,
|
||||
Version: child.version,
|
||||
State: child.getState(),
|
||||
Pid: int32(child.cmd.Process.Pid),
|
||||
|
||||
@ -153,7 +153,14 @@ func prepareProcessLaunch(storageRoot string, req *shared.StartProcessRequest) *
|
||||
os.Chmod(path.Join(verpath, exefile), 0777)
|
||||
|
||||
exef, _ := os.Executable()
|
||||
cmd := exec.Command(path.Join(path.Dir(exef), verpath, exefile), req.Args[1:]...)
|
||||
|
||||
expanded := make([]string, len(req.Args))
|
||||
for i, arg := range req.Args {
|
||||
expanded[i] = os.ExpandEnv(arg)
|
||||
}
|
||||
exename := path.Join(path.Dir(exef), verpath, exefile)
|
||||
|
||||
cmd := exec.Command(os.ExpandEnv(exename), expanded[1:]...)
|
||||
|
||||
cmd.Dir = verpath
|
||||
stdin, _ := cmd.StdinPipe()
|
||||
|
||||
Reference in New Issue
Block a user