Created
October 10, 2013 05:49
-
-
Save sirlancelot/6913635 to your computer and use it in GitHub Desktop.
A Bolt.cm Git pre-commit hook to clear the `bolt_log` upon commit. I use Git for deployment purposes and so storing the database in Git makes this a little easier.
This file contains hidden or 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
| #!/bin/bash -e | |
| # Clear up the log of any database added to the index before committing it. | |
| git diff-index --name-only --cached HEAD \ | |
| | grep -e "database/.*\.db" \ | |
| | while read DB; do | |
| echo "Truncating log table in database: $DB" | |
| sqlite3 "$DB" "DELETE FROM bolt_log; VACUUM;" | |
| git add "$DB" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment