Files
runner-images/images/macos/provision/core/nvm.sh
Mikhail Timofeev cdd8150e00 [macOS] Allow using GitHub PAT to enlarge api requests limit (#4917)
* Use gh api pat

* Add gh token to 10.15

* Add github_api_pat for macos-12
2022-01-20 13:41:21 +03:00

29 lines
914 B
Bash
Executable File

#!/bin/bash -e -o pipefail
###########################################################################
# The script installs node version manager with node versions 10,12 and 14
#
###########################################################################
source ~/utils/utils.sh
VERSION=$(curl -H "Authorization: token $API_PAT" -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
nodeVersions=$(get_toolset_value '.node.nvm_versions[]')
for version in ${nodeVersions[@]}
do
nvm install v${version}
done
# 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"