Skip to content

Commit

Permalink
chore: Check yarn version during bootstrap (#10910)
Browse files Browse the repository at this point in the history
Prevents issues when building with default yarn 1.2.
  • Loading branch information
spalladino authored Dec 20, 2024
1 parent 73eec43 commit cbf949c
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ function check_toolchains {
local node_installed_version=$(node --version | cut -d 'v' -f 2)
if [[ "$(printf '%s\n' "$node_min_version" "$node_installed_version" | sort -V | head -n1)" != "$node_min_version" ]]; then
encourage_dev_container
echo "Minimum Node.js version 18.19.0 not found."
echo "Installation: nvm install 18"
echo "Minimum Node.js version $node_min_version not found (got $node_installed_version)."
echo "Installation: nvm install $node_min_version"
exit 1
fi
# Check for required npm globals.
Expand All @@ -89,6 +89,22 @@ function check_toolchains {
exit 1
fi
done
# Check for yarn availability
if ! command -v yarn > /dev/null; then
encourage_dev_container
echo "yarn not found."
echo "Installation: corepack enable"
exit 1
fi
# Check for yarn version
local yarn_min_version="4.5.2"
local yarn_installed_version=$(yarn --version)
if [[ "$(printf '%s\n' "$yarn_min_version" "$yarn_installed_version" | sort -V | head -n1)" != "$yarn_min_version" ]]; then
encourage_dev_container
echo "Minimum yarn version $yarn_min_version not found (got $yarn_installed_version)."
echo "Installation: yarn set version $yarn_min_version; yarn install"
exit 1
fi
}

case "$cmd" in
Expand Down

0 comments on commit cbf949c

Please sign in to comment.