mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-11 14:51:49 +00:00
Update install.sh
This commit is contained in:
parent
27b84d69ea
commit
2626807234
34
install.sh
34
install.sh
@ -509,21 +509,25 @@ EOF
|
|||||||
|
|
||||||
# Determine the shell configuration file based on the current shell
|
# Determine the shell configuration file based on the current shell
|
||||||
case "$SHELL" in
|
case "$SHELL" in
|
||||||
*/bash)
|
*/bash)
|
||||||
CONFIG_FILE="$HOME/.bashrc"
|
CONFIG_FILE="$HOME/.bashrc"
|
||||||
;;
|
BASH_OR_ZSH=true
|
||||||
*/zsh)
|
append_to_file "$CONFIG_FILE" "$CODE"
|
||||||
CONFIG_FILE="$HOME/.zshrc"
|
;;
|
||||||
;;
|
*/zsh)
|
||||||
*)
|
CONFIG_FILE="$HOME/.zshrc"
|
||||||
echo "Unsupported shell: $SHELL"
|
BASH_OR_ZSH=true
|
||||||
exit 1
|
append_to_file "$CONFIG_FILE" "$CODE"
|
||||||
;;
|
;;
|
||||||
esac
|
*/ash)
|
||||||
|
CONFIG_FILE="$HOME/.profile" # or another appropriate file for ash
|
||||||
# Append the code to the appropriate configuration file
|
append_to_file "$CONFIG_FILE" "$CODE"
|
||||||
append_to_file "$CONFIG_FILE" "$CODE"
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported shell to add node version to the shell: $SHELL"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Source nvm
|
# Source nvm
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
. "$(nvm_install_dir)/nvm.sh"
|
. "$(nvm_install_dir)/nvm.sh"
|
||||||
|
Loading…
Reference in New Issue
Block a user