Skip to content

Instantly share code, notes, and snippets.

@wu-lee
Created August 11, 2015 23:19
Show Gist options
  • Save wu-lee/5a9ba0d1fef4fd636497 to your computer and use it in GitHub Desktop.
Save wu-lee/5a9ba0d1fef4fd636497 to your computer and use it in GitHub Desktop.
An inotifywait driven script to run erica push in a couchdb development directory
#!/bin/bash
root=$(dirname $(readlink -f $0))
app=$(basename $root)
src="$root/render"
couchdb=${couchdb:-http://${couchdb_auth:+$couchdb_auth@}localhost:5984/$app}
while true; do
echo "pushing $src to $couchdb id $app"
erica push $src $couchdb
inotifywait -r $src -e create -e modify -e delete -e move --exclude '/[.]#|~$|#$' || break
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment