Last active
August 29, 2015 14:06
-
-
Save ThiefMaster/20d30a7c95281ada6663 to your computer and use it in GitHub Desktop.
post-checkout githook which cleans up all pyc/pyc/__pycache__ files/folders. to enable, save as post-checkout in .git/hooks and chmod +x
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 | |
prev_head=$1 | |
new_head=$2 | |
checkout_type=$3 | |
[[ $checkout_type == '1' ]] || exit 0 | |
[[ $prev_head == $new_head ]] && exit 0 | |
cd "./$(git rev-parse --show-cdup)" | |
find . \( -name '*.pyc' -or -name '*.pyo' -or -name '__pycache__' \) -exec rm -rf {} + | |
rm -r .coverage htmlcov 2> /dev/null | |
rm -r ~/dev/indico/data/tmp/mako_modules/ 2> /dev/null | |
echo Cleaned up python cache files | |
exit 0 |
I totally need my checkouts to become even slower. Thanks ๐
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
๐