Created
October 23, 2012 12:25
-
-
Save eyedol/3938464 to your computer and use it in GitHub Desktop.
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
if [[ $# -lt 2 ]] | |
then | |
echo "Usage: gen_updates.sh [previous-tag] [current-tag]" | |
exit 1 | |
fi | |
CURRENT_TAG=$2 | |
PREVIOUS_TAG=$1 | |
TMPDIR="/tmp/upgrade_ushahidi" | |
git checkout $CURRENT_TAG | |
mkdir -p $TMPDIR/ushahidi/ | |
# Copy updated files with rsync so we preserve directory structure | |
rsync -Rva $(git diff $PREVIOUS_TAG $CURRENT_TAG --name-only) $TMPDIR/ushahidi/ | |
# Add list of deleted files | |
git diff $PREVIOUS_TAG $CURRENT_TAG --diff-filter=D > $TMPDIR/ushahidi/upgrader_removed_files.txt | |
# Zip everything up | |
rm -f ~/ushahidi_${PREVIOUS_TAG}_${CURRENT_TAG}.zip | |
cd $TMPDIR | |
zip -r ~/ushahidi_${PREVIOUS_TAG}_${CURRENT_TAG}.zip ushahidi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment