Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not source-ing the $NVM_PROFILE after install? #775

Closed
IonicaBizau opened this issue Jun 30, 2015 · 9 comments
Closed

Why not source-ing the $NVM_PROFILE after install? #775

IonicaBizau opened this issue Jun 30, 2015 · 9 comments
Labels
installing node Issues with installing node/io.js versions.

Comments

@IonicaBizau
Copy link
Contributor

Instead of reopening the terminal I did source ~/.bashrc -- which could be added to the install script (install.sh):

source $NVM_PROFILE

If you like the idea, I can create a pull request.

@ljharb
Copy link
Member

ljharb commented Jun 30, 2015

It's not a bad idea.

Although, if we simply want nvm to be active immediately, we could just directly source nvm.sh. Perhaps that'd be better than forcing a re-source of $NVM_PROFILE, which may not always be set?

@IonicaBizau
Copy link
Contributor Author

I agree. Even better! This would look like source $NVM_DIR/nvm.sh, right? 🍀

@ljharb
Copy link
Member

ljharb commented Jun 30, 2015

yes. it'd be . $NVM_DIR/nvm.sh to be more portable, altho the install script is always bash so it's OK either way.

IonicaBizau added a commit to IonicaBizauKitchen/nvm that referenced this issue Jun 30, 2015
Fixes nvm-sh#775. After everything is installed, instead of restarting the terminal, just load the nvm.sh file.
@IonicaBizau
Copy link
Contributor Author

@ljharb Thanks! I opened #776. 😄

@ljharb ljharb added the installing node Issues with installing node/io.js versions. label Jun 30, 2015
IonicaBizau added a commit to IonicaBizauKitchen/nvm that referenced this issue Jul 6, 2015
Fixes nvm-sh#775. After everything is installed, instead of restarting the terminal, just load the nvm.sh file.
@ljharb
Copy link
Member

ljharb commented Sep 13, 2015

@IonicaBizau Turns out this couldn't possibly work, because install.sh is executed, and piped to bash - not sourced directly.

@IonicaBizau
Copy link
Contributor Author

@ljharb Hmm, from what I remember it worked fine for me when I installed it on a different machine. Maybe can it be improved/fixed?

@ljharb
Copy link
Member

ljharb commented Sep 13, 2015

How did you install it on that machine? The install command in the README curls install.sh and pipes it to bash - which won't be the current shell.

@IonicaBizau
Copy link
Contributor Author

@ljharb Confirming this doesn't work. Just tested it. I have in mind two possible solutions:

  • downloading the script and executing it as file (probably then the source will work)
  • adding the source call in the installation command (e.g. curl ... | bash && source ???)

...sorry for this bug. 😢 I'm happy to fix it.

@ljharb
Copy link
Member

ljharb commented Sep 13, 2015

No worries - it's been reverted.

Adding a . $NVM_DIR/nvm.sh line to the command also wouldn't necessarily work, since NVM_DIR won't yet be available in the current shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing node Issues with installing node/io.js versions.
Projects
None yet
Development

No branches or pull requests

2 participants