Files
runner-images/images/linux/scripts/installers/nvm.sh
Mikhail Timofeev e7e66bec69 [Ubuntu] Add a file with global user-related variables and point BASH_ENV variable to it (#2826)
* Add global vars to profile.d

* set BASH_ENV var

* fix comment

* remove extra quotes
2021-03-03 17:45:01 +03:00

19 lines
758 B
Bash

#!/bin/bash -e
################################################################################
## File: nvm.sh
## Desc: Installs Nvm
################################################################################
export NVM_DIR="/etc/skel/.nvm"
mkdir $NVM_DIR
VERSION=$(curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash
echo 'export NVM_DIR=$HOME/.nvm' | tee -a /etc/profile.d/env_vars.sh
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"
# set system node.js as default one
nvm alias default system