From: Sebastien Douheret Date: Thu, 15 Jun 2017 14:28:07 +0000 (+0200) Subject: Auto add var named CLIENT_PROJECT_DIR to environment. X-Git-Tag: v0.1.0-beta~32 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fxds%2Fxds-server.git;a=commitdiff_plain;h=ec22c45b4adaf530c66c053cf4e9408c4f791349 Auto add var named CLIENT_PROJECT_DIR to environment. --- 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{})