Skip to content

Instantly share code, notes, and snippets.

@straydogstudio
Created March 12, 2013 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save straydogstudio/5144094 to your computer and use it in GitHub Desktop.
Save straydogstudio/5144094 to your computer and use it in GitHub Desktop.
Quick cap:deploy for git modified files, with optional pattern matching
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