Auto add var named CLIENT_PROJECT_DIR to environment.
authorSebastien Douheret <sebastien.douheret@iot.bzh>
Thu, 15 Jun 2017 14:28:07 +0000 (16:28 +0200)
committerSebastien Douheret <sebastien.douheret@iot.bzh>
Thu, 15 Jun 2017 14:28:07 +0000 (16:28 +0200)
lib/apiv1/exec.go

index 675f6fb..4994b27 100644 (file)
@@ -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{})