Avoid pollution of environment #170

Merged
merged 1 commit into from Nov 20, 2012

Projects

None yet

2 participants

@tisba
tisba commented Nov 20, 2012

tl;dr I added local to all variables that are used internally to NVM. Variables that are used externally should be prefixed with NVM_.

Some days ago I had a really hard day trying to figure out, why my rake db:migrate task was not working. The issue was, that nvm silently added a VERSION environment variable which is used by rake/rails to force the database migration towards a specific version.

Long story short: nvm was leaking a lot of variables.

You can easily test this by doing something like:

env > env_before
source npm.sh
env > env_after
npm install v0.8.14
env > env_after_install

If you look at a diff of the env_-files you can see what I mean.

@creationix creationix merged commit 59c8eda into creationix:master Nov 20, 2012
@creationix
Owner

Thank you very much. I've been meaning to do this but didn't know how.

@tisba
tisba commented Nov 20, 2012

np

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment