Skip to content

Instantly share code, notes, and snippets.

@iceteabottle
Last active May 31, 2023 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iceteabottle/507b2929daf40e4d88b41ad3d180032d to your computer and use it in GitHub Desktop.
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
#! /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