1 #!/bin/sh 2 3 # post-checkout hook: compile python files to byte code 4 5 prev_HEAD="$1" 6 new_HEAD="$2" 7 new_branch="$3" 8 9 if [ "$new_branch" = 1 ]; then 10 # if branch was changed - remove old bytecode files and outdated docs 11 find . -name '*.py[co]' -delete && 12 rm -rf docs/_build/html docs/html 13 fi && 14 15 python -m compileall -q -x '\.tox/.+' . && 16 python -O -m compileall -q -x '\.tox/.+' . 17 18 exit 0