Files
runner-images/images/ubuntu/scripts/build/install-nvm.sh
T

22 lines
838 B
Bash
Raw Normal View History

2020-10-07 13:49:40 +05:00
#!/bin/bash -e
2020-04-03 16:10:34 +03:00
################################################################################
2023-11-22 21:49:23 +01:00
## File: install-nvm.sh
## Desc: Install Nvm
2020-04-03 16:10:34 +03:00
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/etc-environment.sh
2020-04-03 16:10:34 +03:00
export NVM_DIR="/etc/skel/.nvm"
mkdir $NVM_DIR
2023-07-28 20:18:41 +02:00
VERSION=$(curl -fsSL https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash
setEtcEnvironmentVariable "NVM_DIR" '$HOME/.nvm'
2020-04-03 16:10:34 +03:00
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bash_profile
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
invoke_tests "Tools" "nvm"
2020-04-03 16:10:34 +03:00
2020-06-23 12:09:52 +03:00
# set system node.js as default one
nvm alias default system