]> git.phdru.name Git - git-scripts.git/blob - hooks/post-checkout/compyle
Exclude .tox/ virtual environments when compiling byte code
[git-scripts.git] / hooks / post-checkout / compyle
1 #!/bin/sh
2
3 # post-checkout hook that compiles python files to byte code
4 # if branch was changed
5
6 prev_HEAD="$1"
7 new_HEAD="$2"
8 new_branch="$3"
9
10 if [ "$new_branch" = 1 ]; then
11    python    -m compileall -q -x '\.tox/.+' . &&
12    python -O -m compileall -q -x '\.tox/.+' .
13 fi
14
15 exit 0