diff --git a/tools/clean-repo b/tools/clean-repo new file mode 100755 index 0000000000..70aba4d211 --- /dev/null +++ b/tools/clean-repo @@ -0,0 +1,11 @@ +#!/bin/bash -e + +# Remove .pyc files to prevent loading stale code. +# +# You can run it automatically on checkout: +# +# echo ./tools/clean-repo > .git/hooks/post-checkout +# chmod +x .git/hooks/post-checkout + +cd "$(dirname "$0")/.." +find . -name '*.pyc' -print -delete | sed 's|^|[clean-repo] Deleting |'