Update install_terminal

Added support for NVM (Node Version Manager)
This commit is contained in:
LPJon
2023-08-30 20:29:57 -05:00
committed by GitHub
parent f482f6fc12
commit 7b4e57fd01

View File

@@ -2,6 +2,13 @@
# CWP INSTALL APP TERMINAL # CWP INSTALL APP TERMINAL
yum -y update ca-certificates yum -y update ca-certificates
# NEW CODE
# Use NVM for node.js installation management. Options are "y" or "n" DEFAULT = n
usenvm=n
# Version of Node.js to install. DEFAULT = 16.18.1
nodeversion=16.18.1
if [ "$usenvm" == "n" ]; then
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
@@ -15,6 +22,15 @@ if [ ! -e "/usr/bin/npm" ];then
yum -y install npm --enablerepo=epel yum -y install npm --enablerepo=epel
cd /root cd /root
fi fi
elif [ "$usenvm" == "y" ]; then
if [ ! -d "$HOME/.nvm" ]; then
yum -y install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.bashrc
nvm install "$nodeversion"
nvm use "$nodeversion"
fi
fi
# Old Code # Old Code
#yum -y install gcc-c++ make #yum -y install gcc-c++ make