From deffda072fe53017acd1430278b9cae61752ff80 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Fri, 12 Oct 2012 13:26:40 -0400 Subject: [PATCH] Add a tool for removing stale *.pyc files (imported from commit c0fcfb171932f523fff13f14f09ecf5b3a6b21de) --- tools/clean-repo | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 tools/clean-repo 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 |'