Last active
August 29, 2015 14:01
-
-
Save haruair/5a2526ad319949ea14fb to your computer and use it in GitHub Desktop.
Git diff the extract as a zip file
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 | |
NOW=$(date +"%Y-%m-%d-%H%M%S") | |
DIFF=$(git diff --name-only deploy HEAD) | |
TOPLEVEL=$(git rev-parse --show-toplevel) | |
CURRENT=$(pwd) | |
if [ -z "$DIFF" ] | |
then | |
echo "😝 Sorry no diff in there." | |
else | |
cd "$TOPLEVEL" | |
zip ../$NOW.zip $DIFF | |
git diff deploy HEAD > ../$NOW.changed.txt | |
open .. | |
git tag -f deploy HEAD | |
cd "$CURRENT" | |
echo "🍺 All done. good job!" | |
fi | |
# this script run with deploy tag | |
# put the file into any $PATH with good permission |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment