Created
July 23, 2015 11:48
-
-
Save milo/63232a8279b713fe05b3 to your computer and use it in GitHub Desktop.
Git hook for purging cache
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 | |
# Save as .git/hooks/post-merge | |
# Set execute bit like: chmod ug+x .git/hooks/post-merge | |
purgePath="temp/cache" | |
echo | |
echo -n "HOOK [Purge cache]: " | |
if [ -d "$purgePath" ]; then | |
rm -r "$purgePath" | |
echo "purged" | |
else | |
echo "does not exist, not purged" | |
fi |
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
$ git pull | |
Updating ca87888..7033e58 | |
Fast-forward | |
app/code/modules/Help/Homepage.default.latte | 6 +++--- | |
1 file changed, 3 insertions(+), 3 deletions(-) | |
HOOK [Purge cache]: purged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment