Sublime Forum

Env variables in build system

#1

Hello,

I have created a new build system and I’m trying to pass an env parameter. The doc doesn’t have an actual example for that but I’ve done it this way:

{
  "cmd":"mycmd", "$file"],
  "env":{ "myvar": "myvalue"}
}

It seems to work as I can then have access to the environment variable “myvar” with the value of “myvalue”. However, the problem is that I would like to be able to pass the content of a var, in this precise case I want to use $packages, to pass along the path to the packages folder (plus some subfolders). So I tried:

{
  "cmd":"mycmd", "$file"],
  "env":{ "myvar": "$packages"}
}

But all that does is pass “$packages” as a literal value. I tried without the quotes but that results in a parsing error. Using vars that way works fine for “cmd”, as shown in the online doc, but it doesn’t work for “env”.

Any ideas?

Thanks!

0 Likes