Last active
July 22, 2018 22:37
-
-
Save linssen/5729266 to your computer and use it in GitHub Desktop.
A post checkout hook to automatically remove *.pyc files.
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/sh | |
green='\033[0;32m' | |
nc='\033[0m' | |
# Start from the repository root. | |
cd ./$(git rev-parse --show-cdup) | |
# Delete .pyc files and empty directories. | |
echo "${green}Deleting PYC files...${nc}" | |
find . -name "*.pyc" -delete | |
find . -type d -empty -delete | |
echo "${green}Resetting submodules...${nc}" | |
git submodule foreach git reset --hard HEAD | |
git submodule update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In your comment above, do you mean "post-commit"? Or maybe "post-checkout"?