Created
July 25, 2012 21:27
-
-
Save rjmackay/3178808 to your computer and use it in GitHub Desktop.
Gen update with commandline params
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
#!/bin/bash | |
# To check tags, run this in the browser | |
# https://api.github.com/repos/ushahidi/Ushahidi_Web/tags | |
if [[ $# -lt 2 ]] | |
then | |
echo "Usage: gen_updates.sh [previous-tag] [current-tag]" | |
exit 1 | |
fi | |
CURRENT_TAG=$2 | |
PREVIOUS_TAG=$1 | |
TMPDIR=`mktemp -d -t ushahidi-upgrade.XXXXXXXXXX` | |
git checkout $CURRENT_TAG | |
mkdir $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 | |
pushd $TMPDIR | |
zip -r ~/ushahidi_${PREVIOUS_TAG}_${CURRENT_TAG}.zip ushahidi | |
# Back to where we were | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment