Created
December 12, 2023 23:24
-
-
Save seanhamlin/11927cf1f57e4f6b7bd810bd560ab7f7 to your computer and use it in GitHub Desktop.
This file contains 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
# Use basic filtering of `drush status` to hopefully ensure more broader support | |
# for various drush versions. | |
DRUPAL_VERSION=$(drush status | grep -i "drupal version" | awk '{print $NF}'); | |
if [ "${DRUPAL_VERSION%.*}" == "7" ] ; then | |
if drush cc all; then echo "drush cc all complete"; else exit $?; fi; | |
elif [ "${DRUPAL_VERSION%.*.*}" -ge "8" ] ; then | |
if drush cr -y; then echo "drush cache:rebuild complete"; else exit $?; fi; | |
else \ | |
echo "could not clear cache for found Drupal version ${DRUPAL_VERSION}"; | |
exit 1; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment