Files
cypress/scripts/ensure-node.sh
Tyler Biethman c94fbb6321 chore(deps): Updating to electron@19.0.8 (#22775)
* Trying out electron 19.0.4

* nvm-for-windows 1.1.7 is busted for node-16.14.2

* Went a bit overboard with the exit I think

* Stepping this back

* Breaking out yarn install

* Print runtime data

* log more data points

* well i'm confused. seeing what happens after these steps

* Lets see if powershell picks up the new PATH

* Maybe shell is refreshed between jobs?

* Installing nvm-1.1.9 manually

* Cleaning up circle.yml and a few other node references.

* Yeah that ain't gonna work

* Trying bash implementation

* Urgh yaml

* Bumping to latest patch version

* Getting a full build + artifacts

* Sourcing node in build step

* More node sourcing

* Run against updated recipes repo

* I'll find all these eventually

* Trigger new build after cache busting

* Let's slim this down to test recipes for a bit

* Good ol' working_directory

* Fixing bad syntax

* Not quite sure where all this is necessary at this point

* Using recipes PR branch

* This isn't necessary here

* Re-enabling jobs

* More node sourcing

* Running kitchensink tests against PR branch

* Moving nvm-windows update to script

* Even more node sourcing

* Removing CI config for merged kitchensink/recipes PRs
2022-07-21 13:02:46 -05:00

31 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# `source ./scripts/ensure-node.sh` to ensure you are running the correct Node version for this repo
# The Windows executor ships with nvm-windows 1.1.7, which has compatibility issues with node 16.14.2.
# When 1.1.7 is detected, we manually update to nvm-windows 1.1.9, which includes a fix for 16.14.2 support.
if [[ $PLATFORM == 'windows' && $(echo `nvm version`) == '1.1.7' ]]; then
curl -L -O https://github.com/coreybutler/nvm-windows/releases/download/1.1.9/nvm-noinstall.zip && tar -xvf nvm-noinstall.zip -C C:/ProgramData/nvm
fi
node_version=$(cat .node-version)
# some environments (like Arm/Windows on CircleCI) bring their own nvm
if type nvm &>/dev/null; then
echo 'nvm found with cache dir' `nvm cache dir`
else
if [ -s "${HOME}/.nvm/nvm.sh" ]; then
echo 'nvm found in home, sourcing...'
else
echo "nvm not found. Installing nvm..."
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.39.1/install.sh | bash
fi
source "${HOME}/.nvm/nvm.sh"
fi
echo "Installing Node $node_version"
nvm install ${node_version}
echo "Using Node $node_version"
nvm use ${node_version}
[[ $PLATFORM != 'windows' ]] && nvm alias default ${node_version} || sleep 2s