Files
runner-images/images/macos/provision/core/nvm.sh
Darii Nurgaleev 7403f33180 [macOS] add pester tests to install scripts part-1. (#2286)
* [macOS] add pester tests to install scripts part-1.

* changed version

* added changes related to common utils installation

* added source tests file

* removed tests from homebrew

* moved jq to homebrew

* fix nitpicks

* incorrect things are fixed.

* fixed some mistakes in the text

* commonutils changed.

* remove swiftlint installation from toolsets

* removed useless string
2020-12-23 18:14:13 +03:00

35 lines
1.1 KiB
Bash
Executable File

#!/bin/bash -e -o pipefail
###########################################################################
# The script installs node version manager with node versions 6,8,10 and 12
#
###########################################################################
source ~/utils/utils.sh
source ~/utils/invoke-tests.sh
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
if [ $? -eq 0 ]; then
. ~/.bashrc
nvm --version
nvm install lts/boron # 6.x
nvm install lts/carbon # 8.x
nvm install lts/dubnium # 10.x
nvm install lts/erbium # 12.x
nvm install v13 # 13.x
nvm install v14 # 14.x
nvm alias node6 lts/boron
nvm alias node8 lts/carbon
nvm alias node10 lts/dubnium
nvm alias node12 lts/erbium
nvm alias node13 v13
nvm alias node14 v14
# set system node as default
nvm alias default system
else
echo error
fi
echo "Node version manager has been installed successfully"
invoke_tests "Node" "nvm"