Created
October 31, 2011 19:48
-
-
Save arches/1328653 to your computer and use it in GitHub Desktop.
Git commit hook to package assets using Jammit
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/bash | |
# to install, replace your .git/hooks/pre-commit with this file | |
if [ $staged_asset_count -gt 0 ]; then | |
if [ $changed_asset_count -eq 0 ]; then | |
echo "Packaging css/js assets with jammit..." | |
jammit -f | |
git add public/packaged # you might need to change this based on the package_path you use in your assets.yml | |
else | |
echo "Error: Cannot package css/js assets with jammit." | |
echo | |
echo "Jammit will run against the current state of the filesystem." | |
echo "Running Jammit now would create packaged assets that include unstaged changes." | |
echo "Please stage/stash/revert javascript and css." | |
exit 1 | |
fi | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment