From 642c5fe7594ba019ee1bd0f506e5bf46b5e8a425 Mon Sep 17 00:00:00 2001 From: LPJon <46533576+LPJon@users.noreply.github.com> Date: Thu, 31 Aug 2023 03:29:29 -0500 Subject: [PATCH] Update install_terminal added support for switching between rpm nodejs and nvm nodejs --- install_terminal | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/install_terminal b/install_terminal index 3acba0b..97eb896 100644 --- a/install_terminal +++ b/install_terminal @@ -13,7 +13,14 @@ function getsystemnodeversion { /usr/bin/node -v fi } +function checkfornodejsrpm { + yum list installed nodejs | grep nodejs +} if [ "$usenvm" == "n" ]; then + if [ -e "$HOME/.nvm" ]; then + if [ -z "$(checkfornodejsrpm)" ]; then + rm -f /usr/bin/node + fi if [ ! -e "/usr/bin/node" ];then yum -y install nodejs --enablerepo=epel cd /root @@ -28,6 +35,9 @@ if [ "$usenvm" == "n" ]; then cd /root fi elif [ "$usenvm" == "y" ]; then + if [ ! -z "$(checkfornodejsrpm)" ]; then + yum -y remove nodejs + fi if [ -e "$HOME/.nvm" ];then export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm