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

23 lines
850 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-12-29 12:36:27 +01:00
nvm_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/$nvm_version/install.sh | bash
2023-12-26 12:50:52 +01:00
set_etc_environment_variable "NVM_DIR" '$HOME/.nvm'
2023-12-29 12:36:27 +01:00
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