Skip to content

Instantly share code, notes, and snippets.

@dasginganinja
Created June 5, 2017 15:38
Show Gist options
  • Save dasginganinja/ee28558be625241025e65c9da83d0f6b to your computer and use it in GitHub Desktop.
Save dasginganinja/ee28558be625241025e65c9da83d0f6b to your computer and use it in GitHub Desktop.
Bash Script for easily seeing differences between module versions
#!/bin/bash
MODULE=$1
VERFROM=$2
VERTO=$3
shift
shift
shift
if [ "$MODULE" == "" ] || [ "$VERFROM" == "" ] || [ "$VERTO" == "" ]
then
echo "Usage: $0 module version-from version-to"
printf "\tExample: $0 ldap 7.x-2.1 7.x-2.2\n"
exit 1
fi
NOW=$(date +"%Y%m%dT%H%M%S")
DIFFOLDER="/tmp/${MODULE}_${VERFROM}_${VERTO}_${NOW}"
MODFROM="$MODULE-$VERFROM"
MODTO="$MODULE-$VERTO"
echo "Creating $DIFFOLDER"
mkdir $DIFFOLDER
cd $DIFFOLDER
drush @none dl $MODFROM
mv $MODULE $MODFROM
drush @none dl $MODTO
mv $MODULE $MODTO
diff -qr "$MODFROM" "$MODTO"
diff -x '*.info' -r "$MODFROM" "$MODTO"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment