Files
runner-images/images/linux/scripts/installers/nvm.sh
Dmitry Shibanov 712cbbe2e1 Add nvm for linux (#582)
Install nvm on both Ubuntu 16.04 and Ubuntu 18.04 images.

Authored-by: Dmitry Shibanov <v-dmshib@microsoft.com>
2020-04-03 09:10:34 -04:00

22 lines
768 B
Bash

#!/bin/bash
################################################################################
## File: nvm.sh
## Desc: Installs Nvm
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
export NVM_DIR="/etc/skel/.nvm"
mkdir $NVM_DIR
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
echo 'export NVM_DIR=$HOME/.nvm' | tee -a /etc/skel/.bash_profile
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"
if ! command -v nvm; then
echo "nvm was not installed"
exit 1
fi
DocumentInstalledItem "nvm ($(nvm --version))"