Created
March 12, 2013 15:58
-
-
Save straydogstudio/5144094 to your computer and use it in GitHub Desktop.
Quick cap:deploy for git modified files, with optional pattern matching
This file contains 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
function capdu { | |
if [ -z "$1" ] | |
then | |
FILES=`gst | grep modified: | ruby -e 'puts ARGF.map {|l| l.split()[2]}.join(",")' | xargs echo` | |
else | |
FILES=`gst | grep modified: | grep $1 | ruby -e 'puts ARGF.map {|l| l.split()[2]}.join(",")' | xargs echo` | |
fi | |
if [ -z "$FILES" ] | |
then | |
echo "No modified files exist" | |
else | |
echo "Sending FILES: $FILES" | |
cap deploy:upload FILES=$FILES deploy:restart | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment