mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[macOS] Rename build scripts (#8887)
Co-authored-by: Alexey Ayupov <“alexey.ayupov@akvelon.com”>
This commit is contained in:
31
images/macos/scripts/build/install-nvm.sh
Normal file
31
images/macos/scripts/build/install-nvm.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash -e -o pipefail
|
||||
################################################################################
|
||||
## File: install-nvm.sh
|
||||
## Desc: Install node version manager
|
||||
################################################################################
|
||||
|
||||
source ~/utils/utils.sh
|
||||
|
||||
[ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}")
|
||||
VERSION=$(curl "${authString[@]}" -fsSL https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
|
||||
download_with_retries "https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh" "/tmp" "nvm-install.sh"
|
||||
bash /tmp/nvm-install.sh
|
||||
|
||||
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"
|
||||
Reference in New Issue
Block a user