Last active
May 31, 2023 16:57
-
-
Save iceteabottle/507b2929daf40e4d88b41ad3d180032d to your computer and use it in GitHub Desktop.
[Install cypress only if the binary is missing] Check if cypress needs to be installed e.g. within the CI #cypress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
export CYPRESS_PACKAGE_VERSION=$(npx cypress --version --component package) | |
export CYPRESS_BINARY_VERSION=$(npx cypress --version --component binary) | |
echo "Cypress version:" | |
echo " - package: ${CYPRESS_PACKAGE_VERSION}" | |
echo " - binary: ${CYPRESS_BINARY_VERSION}" | |
if [[ "${CYPRESS_PACKAGE_VERSION}" != "${CYPRESS_BINARY_VERSION}" ]]; then | |
echo "Current cypress version is not installed. Installing now ${CYPRESS_PACKAGE_VERSION}..." | |
export CYPRESS_INSTALL_BINARY=${CYPRESS_PACKAGE_VERSION} | |
npx cypress install | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment