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

nvm fix to work for other shells #430

Closed
danielb2 opened this issue Jun 4, 2014 · 6 comments
Closed

nvm fix to work for other shells #430

danielb2 opened this issue Jun 4, 2014 · 6 comments

Comments

@danielb2
Copy link
Contributor

danielb2 commented Jun 4, 2014

I'm using fish-shell and I'm unable to use nvm as it stands.

However, with a wrapper file cat nvm:

#!/bin/bash

if [[ -s $HOME/.nvm/nvm.sh ]] ;
  then
    source $HOME/.nvm/nvm.sh;
  else
    echo "No nvm found in `$HOME/.nvm/nvm.sh`";
fi

nvm $@

I can easily use it. However, it does not set the PATH.

Setting the default node could easily be accomplished if a .nvm/default pointed to the default version. For example, .nvm/default -> v0.10.28/

I suggest that nvm alias default 0.10.28 create such a link as then I could easily alter my path to include .nvm/default/bin

@danielb2
Copy link
Contributor Author

Were there any thoughts on this? I'd like to be able to use other shells easily with this.

@ljharb
Copy link
Member

ljharb commented Jun 23, 2014

fish is the only shell that it doesn't work with, and it's so vastly different from other POSIX-compliant shells that there's not going to be a fast solution. You can look into https://github.com/Alex7Kom/nvm-fish for the time being as well.

@danielb2
Copy link
Contributor Author

Yes, but wouldn't my solution work for all shells? since it uses a bash wrapper? And isn't that a better solution as it's generic?

@ljharb
Copy link
Member

ljharb commented Jun 24, 2014

Your approach would re-source nvm.sh on every call to nvm - that doesn't seem like the approach we want here.

I'd be OK with nvm alias default (and only default) creating a symlink in ~/.nvm - as well as nvm use creating a symlink under ~/.nvm/current. Please feel free to submit (separate) PRs for those if you're interested!

@danielb2
Copy link
Contributor Author

OK, will do. One of the issues I had was actually that nvm tended to pollute my path in bash. I'll have a look at implementing it

@danielb2
Copy link
Contributor Author

See PR here: #447

I wasn't sure what to do for a test though.

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

No branches or pull requests

2 participants