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

Sourcing NVM does not work in ZSH #14

Closed
wavded opened this issue Jan 11, 2011 · 5 comments
Closed

Sourcing NVM does not work in ZSH #14

wavded opened this issue Jan 11, 2011 · 5 comments

Comments

@wavded
Copy link

wavded commented Jan 11, 2011

A very simple fix will get this to work in both BASH and ZSH in nvm.sh export NVM_DIR.

Use

!$

Instead of

$BASH_ARGV[0]

For me it worked in both shells. Once I switched that everything else seems to work.

@creationix
Copy link
Collaborator

Hmm, doesn't work for me. I get "," for $NVM_DIR which isn't going to work.

@wavded
Copy link
Author

wavded commented Jan 11, 2011

You're right! Hmm... there has to be some ZSH equiv... I'll keep looking.

@yibe
Copy link

yibe commented Jan 17, 2011

By replacing the line with the following, nvm worked well with both shells, at least in my env. (I'm not sure if it's the best solution, though) :

export NVM_DIR=$(cd $(dirname ${BASH_SOURCE[0]:-$0}); pwd)

Anyway, please note that cd ...; pwd is needed in case the argument is a relative path.

@wavded
Copy link
Author

wavded commented Jan 20, 2011

Your solution worked for me yibe, I made a pull request to creationix to see if it will work for his BASH. Hopefully!

@creationix
Copy link
Collaborator

Pull accepted :)

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

No branches or pull requests

3 participants