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

Fix which command in zsh (#604). #605

Merged
merged 2 commits into from
Jan 2, 2015
Merged

Fix which command in zsh (#604). #605

merged 2 commits into from
Jan 2, 2015

Conversation

dhcmrlchtdj
Copy link
Contributor

use command which to ignore zsh's buildin command which.

zsh's which will not return the path to node if someone create a alias like alias node="node --harmony".

@ljharb
Copy link
Member

ljharb commented Jan 2, 2015

Thanks!

This works well in all tested shells, but fails the nvm_ls_current tests in zsh only.

If you can both a) add a test that would fail without this change, and b) make that failing test pass both with and without this change, then I'm happy to merge this.

@dhcmrlchtdj
Copy link
Contributor Author

er, I need some help.
It can be test by the follow command, but I'm not familiar with shell script.

$ alias node="node --harmony" && nvm use v0.11.14 &> /dev/null && nvm current
v0.11.14 # pass
system # failure

nvm use doesn't work as I expected in script.

@ljharb
Copy link
Member

ljharb commented Jan 2, 2015

You got the existing test passing, and I think i can modify the nvm_ls_current tests to test for this pretty easily. Thanks, I'll merge this now.

ljharb added a commit that referenced this pull request Jan 2, 2015
@ljharb ljharb merged commit 67e8939 into nvm-sh:master Jan 2, 2015
ljharb added a commit that referenced this pull request Jan 2, 2015
@ljharb ljharb mentioned this pull request Jan 2, 2015
@dhcmrlchtdj dhcmrlchtdj deleted the fix_which branch February 10, 2015 13:39
@ljharb ljharb added the shell alias clobbering Anything dealing with users shadowing builtins with aliases or functions. label Feb 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
shell alias clobbering Anything dealing with users shadowing builtins with aliases or functions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants