Skip to content

Instantly share code, notes, and snippets.

@guybowden
Created August 29, 2017 13:45
Show Gist options
  • Save guybowden/c495730ee5a9d169ae77076adf216ad3 to your computer and use it in GitHub Desktop.
Save guybowden/c495730ee5a9d169ae77076adf216ad3 to your computer and use it in GitHub Desktop.
Post commit hook to copy procfile if migrations are detected
#!/bin/sh
SRC_PATTERN="migrations/"
git show --name-only | if grep --quiet "$SRC_PATTERN"
then
cp Procfile_with_release Procfile
git commit . -m "Added release command since a migration file was modified or created."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment