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