Skip to content

Instantly share code, notes, and snippets.

@greggles
Created August 2, 2014 23:16
Show Gist options
  • Save greggles/a0bb1a7e9adf2a31aaf2 to your computer and use it in GitHub Desktop.
Save greggles/a0bb1a7e9adf2a31aaf2 to your computer and use it in GitHub Desktop.
find overridden features and fail the job
#!/bin/bash
# Bring out the noise.
set -ux
# Look for modified features.
MODIFIED_FEATURES=`drush @drush.alias fl | grep -Eio "[a-z].*enabled.*7\..*overridden"`
if [ -z "$MODIFIED_FEATURES" ]
then
# If they are not modified, you can do stuff here.
else
# Print them out.
echo "========================================================================="
echo "================The following features have been modified...============="
echo "========================================================================="
echo $MODIFIED_FEATURES
echo "========================================================================="
# exit 1 makes the job fail so it sends a fail email.
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment