Files
runner-images-sangeeth/images/macos/provision/core/nvm.sh
T

29 lines
852 B
Bash
Raw Normal View History

#!/bin/bash -e -o pipefail
2020-09-10 14:34:08 +03:00
###########################################################################
# The script installs node version manager with node versions 10,12 and 14
2020-09-10 14:34:08 +03:00
#
###########################################################################
source ~/utils/utils.sh
2020-10-01 11:31:02 +02:00
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
2020-09-10 14:34:08 +03:00
if [ $? -eq 0 ]; then
. ~/.bashrc
nvm --version
nodeVersions=("v10" "v12" "v14")
for version in ${nodeVersions[@]}
do
nvm install $version
done
# set system node as default
nvm alias default system
2020-09-10 14:34:08 +03:00
else
2020-10-01 11:31:02 +02:00
echo error
2020-09-10 14:34:08 +03:00
fi
echo "Node version manager has been installed successfully"
invoke_tests "Node" "nvm"