Using existing environment variables in config

Issue #1 resolved
mjbogusz created an issue

Hi,

thanks for the great plugin - it’s exactly what I needed to setup Sublime+ECC for ROS development!

There is one minor enhancement I’d like to suggest: using existing ENV variables' values in the configuration.

Example usecase - extending a variable like PATH, PYTHONPATH or basically any other *PATH. As of now the only way is to create an env_file for each OS (btw this note could be added into readme), while it might be easier (and cleaner - 1 file less) to just write e.g.:

{
  "settings": {
    "project_environment": {
      "env": {
        "PATH": "/opt/some_software/bin:$PATH"
      }
    }
  }
}

That would be a nice enhancement, unless this functionality is available already and I’m just blind and cannot read readmes… 😉

Comments (4)

  1. Daniele Niero repo owner

    Hi,
    Sorry for the late reply.

    The problem here is that PATH is valid in linux and mac, but fails on Windows.
    Previous versions of this plugin did exactly that, but I wanted to make the settings more portable, mainly because I switch often between systems.
    That said I see your point. This is even more obvious if you work in Linux and Mac… that PATH can be valid in both but as for now you must specify it twice.

    I’m very busy and I will be for quite some time, so I won’t be able to do any work on this plugin until things will get more calm.
    I think your criticism is valid so I want to do something about it, but I’m afraid it will take time.

  2. mjbogusz reporter

    I can see how properly supporting existing environment variables in the config would be a difficult task.

    I think for now the quick, easy and portable solution is to simply add a note in the readme explaining that it’s not possible to use existing environment variables in the configuration itself and to instead use a separate env_file for each OS.

  3. Daniele Niero repo owner

    As they say, better late than never.
    This should be now implemented.

    Before to declare this issue solved, however, I’d like to have a confirmation that it is, in fact, solved.

  4. Log in to comment