Capture environmental variables using atom.config.get


#1

I am using an autocomplete package for the rust language (racer), which requires access to some directories on my local machine to do its autocompletion. Specifically, this package needs to load the files in these directories, otherwise it gives an error (well known issue and is in the FAQ: https://github.com/edubkendo/atom-racer#racer-doesnt-work-or-i-see-plugin-errors-when-i-type)

Everything works as expected if I use a full path in the settings for the two required path variables: racerBinPath and rustSrcPath. The issue that I have is that if I use an environmental variable to access these paths, the package complains that it isn’t able to find the required files - I’m assuming this is because it doesn’t expand the environmental variable I’m using (i.e. $HOME on Linux into /home/user).

After some googling, I came across some similar issues where users were unable to get access to $PATH, but surprisingly, I was only able to find issues on Macs. I’m not sure if this is a related issue, but it

Looking at the source of racer, I was able to find where it reads one of the settings into its namespace: https://github.com/edubkendo/atom-racer/blob/master/lib/racer-client.coffee#L81-L89

The line that is failing reads conf_bin = atom.config.get("racer.racerBinPath"). Is there any additional information I could give to atom to successfully read an environmental variable?

Thanks in advance,
cbcoutinho