Skip to content

Commit

Permalink
Update install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivas365 authored Sep 16, 2024
1 parent 27b84d6 commit 2626807
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -509,21 +509,25 @@ EOF

# Determine the shell configuration file based on the current shell
case "$SHELL" in
*/bash)
CONFIG_FILE="$HOME/.bashrc"
;;
*/zsh)
CONFIG_FILE="$HOME/.zshrc"
;;
*)
echo "Unsupported shell: $SHELL"
exit 1
;;
esac

# Append the code to the appropriate configuration file
append_to_file "$CONFIG_FILE" "$CODE"

*/bash)
CONFIG_FILE="$HOME/.bashrc"
BASH_OR_ZSH=true
append_to_file "$CONFIG_FILE" "$CODE"
;;
*/zsh)
CONFIG_FILE="$HOME/.zshrc"
BASH_OR_ZSH=true
append_to_file "$CONFIG_FILE" "$CODE"
;;
*/ash)
CONFIG_FILE="$HOME/.profile" # or another appropriate file for ash
append_to_file "$CONFIG_FILE" "$CODE"
;;
*)
echo "Unsupported shell to add node version to the shell: $SHELL"
;;
esac

# Source nvm
# shellcheck source=/dev/null
. "$(nvm_install_dir)/nvm.sh"
Expand Down

0 comments on commit 2626807

Please sign in to comment.