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

Shell detection fails in install script in some instances #2555

Closed
tg90nor opened this issue Aug 12, 2021 · 2 comments · Fixed by #2556
Closed

Shell detection fails in install script in some instances #2555

tg90nor opened this issue Aug 12, 2021 · 2 comments · Fixed by #2556
Labels
installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file.

Comments

@tg90nor
Copy link
Contributor

tg90nor commented Aug 12, 2021

The install script incorrectly added nvm config to my .bashrc even though I'm using zsh.
I believe this part of the install script is the problem: https://github.com/nvm-sh/nvm/blob/master/install.sh#L280
My understanding of it is it basically undoes the detection above and goes ahead with .bashrc because the file exists.

@tg90nor
Copy link
Contributor Author

tg90nor commented Aug 12, 2021

Sorry, my assessment was wrong. I think it will always detect bash because that's the shell the install script runs in

@tg90nor
Copy link
Contributor Author

tg90nor commented Aug 12, 2021

You should probably look at the $SHELL variable instead

[~] ❯ bash -c 'echo $BASH_VERSION'
3.2.57(1)-release
[~] ❯ bash -c 'echo $ZSH_VERSION'

[~] ❯ echo $ZSH_VERSION
5.8
[~] ❯ bash -c 'echo $SHELL'
/usr/local/bin/zsh

@ljharb ljharb added the installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. label Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants