Files
runner-images-sangeeth/images/ubuntu/scripts/build/install-nvm.sh
Shamil Mubarakshin 435ba67550 [ubuntu] Unify approach to /etc/environment (#8904)
* [ubuntu] Unify approach to /etc/environment

* [ubuntu] fix typo in XDG_CONFIG_HOME name
2023-11-28 15:19:44 +01:00

22 lines
838 B
Bash

#!/bin/bash -e
################################################################################
## File: install-nvm.sh
## Desc: Install Nvm
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/etc-environment.sh
export NVM_DIR="/etc/skel/.nvm"
mkdir $NVM_DIR
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'
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