SimonDesautels
3/5/2014 - 1:17 PM

CodeKit 2 hook: auto-commit changes to local git repo

CodeKit 2 hook: auto-commit changes to local git repo

# terminal-notifier available at https://github.com/alloy/terminal-notifier

PROJECT_PATH="/Users/username/Path/To/Project/"
GITFILE="$PROJECT_PATH.git"

if [ ! -e $GITFILE ]
then
	cd $PROJECT_PATH && git init && git add . && git commit -m 'initial commit'
	terminal-notifier -message "Created local git repo with initial commit" -title "CodeKit hook: git"	
else
	cd $PROJECT_PATH && git add -A && git commit -m 'auto-commit on save (via codekit hook)'
	terminal-notifier -message "Auto-commited changes to git" -title "CodeKit hook: git"	
fi