From ec22c45b4adaf530c66c053cf4e9408c4f791349 Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Thu, 15 Jun 2017 16:28:07 +0200 Subject: [PATCH 1/1] Auto add var named CLIENT_PROJECT_DIR to environment. --- lib/apiv1/exec.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/apiv1/exec.go b/lib/apiv1/exec.go index 675f6fb..4994b27 100644 --- a/lib/apiv1/exec.go +++ b/lib/apiv1/exec.go @@ -184,6 +184,9 @@ func (s *APIService) execCmd(c *gin.Context) { cmd = append(cmd, args.Args...) } + // Append client project dir to environment + args.Env = append(args.Env, "CLIENT_PROJECT_DIR="+prj.RelativePath) + s.log.Debugf("Execute [Cmd ID %d]: %v", cmdID, cmd) data := make(map[string]interface{}) -- 2.16.6