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

Modifying a file when .bashrc and .zshrc are present #592

Open
JJ opened this issue Dec 10, 2014 · 6 comments · May be fixed by #2260
Open

Modifying a file when .bashrc and .zshrc are present #592

JJ opened this issue Dec 10, 2014 · 6 comments · May be fixed by #2260
Labels
installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. pull request wanted This is a great way to contribute! Help us out :-D shell: zsh

Comments

@JJ
Copy link

JJ commented Dec 10, 2014

I just switched to zsh so still there's .bashrc and .zshrc present in my ~ . However, it's choosing .bashrc over the one I'm actually using, so I copied it by hand. I know it's a particular problem, but maybe the script could check the current shell and modify whatever file suits it?

@ljharb
Copy link
Member

ljharb commented Dec 10, 2014

That sounds great in theory but I suspect it would be really complex in practice. I'll leave this open so anyone can contribute ideas - PRs welcome also :-)

@jeanlucaslima
Copy link

There's an environment variable called $SHELL that stores the default shell, even if you are running other shell at the moment.

echo-shell

@ljharb
Copy link
Member

ljharb commented Jan 24, 2015

When installing nvm, I'd expect it to be installed in the current shell, not the default shell.

@JJ
Copy link
Author

JJ commented Jan 24, 2015

I'd go for $SHELL, then. At any rate, checking $SHELL instead of just
installing it in whatever .*rc file you find first might be a better
solution.

@jeanlucaslima
Copy link

@ljharb, if you want just for the current shell, you can use echo $0. But I'd vote for default shell.

@ljharb
Copy link
Member

ljharb commented Jan 24, 2015

Certainly if we went with the default shell you'd be able to do SHELL=zsh . install.sh or SHELL=bash . install.sh to override it, so that's not a horrible idea.

@ljharb ljharb added installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. pull request wanted This is a great way to contribute! Help us out :-D labels Apr 5, 2015
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. pull request wanted This is a great way to contribute! Help us out :-D shell: zsh
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants