/bin/bash
2012-01 johnpfeiffer speed up commit/upload process
function addcommit() { if [ $# -ne 1 ]; then echo "Error: no parameter given to addcommit()" exit 0 else git add $1 echo "git commit $1 " git commit $1 fi }
function pullpush() { echo "Pulling any server changes first: git pull " git pull echo "Pushing change: git push " git push }
----- main ----------------------
if [ $# -ne 1 ]; then echo "Not Enough Parameters, usage is: $0 filename (or $0 directoryname) " exit 1 else TARGET=$1 if [ -f $TARGET ]; then echo "File: git add $TARGET " addcommit $TARGET pullpush else if [ -d $TARGET ]; then echo "Directory: git add $TARGET " addcommit $TARGET pullpush else echo "$TARGET not found" fi fi fi