golang / sublime-config

A library for Go environment configuration in Sublime Text
BSD 3-Clause "New" or "Revised" License
86 stars 24 forks source link

support shell variable expansion, like $HOME #3

Open mpvl opened 8 years ago

mpvl commented 8 years ago

Go Sublime supported this, so it will make the transition from Go Sublime more straightforwards.

Alternatively, give a better error message that a given path could not be found. I got an error message that my GOPATH was not defined, rather than pointing to a non-existing directory.

wbond commented 8 years ago

While I understand the motivation, I'm not convinced adding environment variable expansion is the right move, mostly because it is sort of open-ended and may be harder to document.

Some thoughts related to the implementation and documentation I have are:

If I were to answer the question, I would probably say to do the following if we were going to add support:

jbuberel commented 8 years ago

I opened #4 to address the error reporting issue. Let's focus this on variable expansion.

I like Will's suggestion of only offering this for a limited set of variables. But I think this could also be added later (post 1.0). That being said, I am not a heavy user of GoSublime, and can't comment on how useful that feature is/isn't to general users.

wbond commented 8 years ago

@mpvl Did you manually enter your GOPATH into Sublime Text, or was your $GOPATH env var set to $HOME/...?

As a follow up, if you did enter it into the Sublime Text settings, was ST not able to fetch it from your shell?

If you did not enter it into the settings, could you execute the following in your Sublime Text console and tell me the output?

import shellenv
shell, env = shellenv.get_env()
env.get('GOPATH')
wbond commented 8 years ago

@mpvl Ping

tamird commented 7 years ago

@wbond another use case that would be addressed by this is appending to $PATH rather than overwriting it outright, which is currently (infuriatingly) the only option.