mirror of
https://github.com/LPJon/cwpfixes.git
synced 2026-09-10 22:20:47 -05:00
Update install_terminal
added support for switching between rpm nodejs and nvm nodejs
This commit is contained in:
@@ -13,7 +13,14 @@ function getsystemnodeversion {
|
|||||||
/usr/bin/node -v
|
/usr/bin/node -v
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
function checkfornodejsrpm {
|
||||||
|
yum list installed nodejs | grep nodejs
|
||||||
|
}
|
||||||
if [ "$usenvm" == "n" ]; then
|
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
|
if [ ! -e "/usr/bin/node" ];then
|
||||||
yum -y install nodejs --enablerepo=epel
|
yum -y install nodejs --enablerepo=epel
|
||||||
cd /root
|
cd /root
|
||||||
@@ -28,6 +35,9 @@ if [ "$usenvm" == "n" ]; then
|
|||||||
cd /root
|
cd /root
|
||||||
fi
|
fi
|
||||||
elif [ "$usenvm" == "y" ]; then
|
elif [ "$usenvm" == "y" ]; then
|
||||||
|
if [ ! -z "$(checkfornodejsrpm)" ]; then
|
||||||
|
yum -y remove nodejs
|
||||||
|
fi
|
||||||
if [ -e "$HOME/.nvm" ];then
|
if [ -e "$HOME/.nvm" ];then
|
||||||
export NVM_DIR="$HOME/.nvm"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||||
|
|||||||
Reference in New Issue
Block a user