Skip to content

Commit

Permalink
Detect shell type from $SHELL variable instead of .$SHELLrc files
Browse files Browse the repository at this point in the history
  • Loading branch information
CristianCantoro committed Jun 12, 2015
1 parent fe044c5 commit 10f9820
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ install_nvm_as_script() {
# Otherwise, an empty string is returned
#
nvm_detect_profile() {
if [ -f "$PROFILE" ]; then
SHELLTYPE="$(basename $(which $SHELL))"
if [ $SHELLTYPE = "bash" ]; then
echo "$HOME/.bashrc"
elif [ $SHELLTYPE = "zsh" ]; then
echo "$HOME/.zshrc"
elif [ -f "$PROFILE" ]; then
echo "$PROFILE"
elif [ -f "$HOME/.bashrc" ]; then
echo "$HOME/.bashrc"
Expand Down

0 comments on commit 10f9820

Please sign in to comment.