diff --git a/client/client.go b/client/client.go index 6f92c50..4bdd2cf 100644 --- a/client/client.go +++ b/client/client.go @@ -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), diff --git a/client/operation.go b/client/operation.go index e030857..d85eef3 100644 --- a/client/operation.go +++ b/client/operation.go @@ -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() diff --git a/go.mod b/go.mod index 89ddb3c..5b723a6 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( golang.org/x/text v0.10.0 google.golang.org/grpc v1.56.0 google.golang.org/protobuf v1.31.0 - repositories.action2quare.com/ayo/gocommon v0.0.0-20231129083505-4089ac0bc1c3 + repositories.action2quare.com/ayo/gocommon v0.0.0-20231129091721-9b8757acda94 ) require ( diff --git a/go.sum b/go.sum index e83d8bf..c4bbfdd 100644 --- a/go.sum +++ b/go.sum @@ -120,5 +120,5 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= howett.net/plist v1.0.0 h1:7CrbWYbPPO/PyNy38b2EB/+gYbjCe2DXBxgtOOZbSQM= howett.net/plist v1.0.0/go.mod h1:lqaXoTrLY4hg8tnEzNru53gicrbv7rrk+2xJA/7hw9g= -repositories.action2quare.com/ayo/gocommon v0.0.0-20231129083505-4089ac0bc1c3 h1:6z9LSH6Bjz3s4xqPoAJqj8dfGERCWFut7zG4RcdsmSU= -repositories.action2quare.com/ayo/gocommon v0.0.0-20231129083505-4089ac0bc1c3/go.mod h1:XvklTTSvQX5uviivGBcZo8eIL+mV94W2e4uBBXcT5JY= +repositories.action2quare.com/ayo/gocommon v0.0.0-20231129091721-9b8757acda94 h1:d0qAzMqhZTqUp9jAuK5oHUkylD2z/HaDoE6yQxYlRoc= +repositories.action2quare.com/ayo/gocommon v0.0.0-20231129091721-9b8757acda94/go.mod h1:XvklTTSvQX5uviivGBcZo8eIL+mV94W2e4uBBXcT5JY=