mirror of
https://github.com/LPJon/cwpfixes.git
synced 2026-09-10 22:20:47 -05:00
Update install_netdata
Added code to load NVM while still in the script
This commit is contained in:
@@ -29,7 +29,9 @@ function installnodeJS {
|
|||||||
fi
|
fi
|
||||||
elif [ "$usenvm" == "y" ]; then
|
elif [ "$usenvm" == "y" ]; then
|
||||||
if [ -e "$HOME/.nvm" ];then
|
if [ -e "$HOME/.nvm" ];then
|
||||||
source $HOME/.bashrc
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||||
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||||
nvm install $nodeversion
|
nvm install $nodeversion
|
||||||
nvm use $nodeversion
|
nvm use $nodeversion
|
||||||
if [ "$(getsystemnodeversion)" != "v$nodeversion" ]; then
|
if [ "$(getsystemnodeversion)" != "v$nodeversion" ]; then
|
||||||
@@ -39,7 +41,9 @@ function installnodeJS {
|
|||||||
if [ ! -e "$HOME/.nvm" ]; then
|
if [ ! -e "$HOME/.nvm" ]; then
|
||||||
yum -y install curl
|
yum -y install curl
|
||||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
|
||||||
source $HOME/.bashrc
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||||
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||||
nvm install "$nodeversion"
|
nvm install "$nodeversion"
|
||||||
nvm use "$nodeversion"
|
nvm use "$nodeversion"
|
||||||
ln -sf /root/.nvm/versions/node/v"$nodeversion"/bin/node /usr/bin/node
|
ln -sf /root/.nvm/versions/node/v"$nodeversion"/bin/node /usr/bin/node
|
||||||
|
|||||||
Reference in New Issue
Block a user