From 9b9c3eaa4dca28bcf795e7f33b58d9f9213323a6 Mon Sep 17 00:00:00 2001 From: mountain Date: Tue, 30 May 2023 16:29:14 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B5=9C=EC=B4=88=20deploy=ED=9B=84=20arg?= =?UTF-8?q?=EA=B0=80=20=EC=95=88=EB=B3=B4=EC=9D=B4=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/operation.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/operation.go b/client/operation.go index 94dd5dc..2580f68 100644 --- a/client/operation.go +++ b/client/operation.go @@ -14,6 +14,7 @@ import ( "path/filepath" "regexp" "runtime/debug" + "strings" "syscall" "time" @@ -175,6 +176,7 @@ func prepareProcessLaunch(req *shared.StartProcessRequest) *procmeta { fi, err := os.Stat(verpath) if err == nil && fi.IsDir() { + args[0] = "./" + path.Clean(strings.TrimPrefix(args[0], "/")) cmd := exec.Command(args[0], args[1:]...) cmd.Dir = verpath stdin, _ := cmd.StdinPipe() @@ -341,6 +343,13 @@ func (hc *houstonClient) startChildProcess(req *shared.StartProcessRequest) erro } // launch가 성공하면 args 저장. this and parent folder + vers := hc.deploys[req.Name] + for _, ver := range vers { + if ver.Version == req.Version { + ver.Args = meta.cmd.Args + } + } + if argfile, err := os.Create(path.Join(req.Name, "@args")); err == nil { enc := json.NewEncoder(argfile) enc.Encode(meta.cmd.Args)