]> git.phdru.name Git - git-scripts.git/blob - hooks/post-checkout/compyle
Use `git var GIT_EDITOR` to call editor
[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    python2.7 -m compileall -q . &&
12    python2.7 -O -m compileall -q .
13 fi
14
15 exit 0