Last active
December 11, 2015 18:09
-
-
Save wbrady/4639822 to your computer and use it in GitHub Desktop.
NIC+ post-merge git hook
This file contains 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/sh | |
diff=`git diff --name-only HEAD@{1} HEAD` | |
packages=`expr "$diff" : ".*package.json.*"` | |
if [ ! "$packages" -eq 0 ] | |
then | |
echo "Installing new packages" | |
npm install | |
fi | |
migrate=`expr "$diff" : ".*migrations/.*"` | |
if [ ! "$migrate" -eq 0 ] | |
then | |
echo "Migrating dev database" | |
db-migrate up | |
echo "Migrating test database" | |
db-migrate up -e test | |
fi | |
seed=`expr "$diff" : ".*seed/.*"` | |
if [ ! "$seed" -eq 0 ] | |
then | |
echo "Seeding data" | |
node seed | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment