]> git.phdru.name Git - git-scripts.git/blob - add-pubkey/post-checkout
7394a6219092524f0b5310fad055ccebd8102869
[git-scripts.git] / add-pubkey / post-checkout
1 #!/bin/sh
2
3 # post-checkout hook that compiles python files to byte code
4 # if branch was changed or removes byte code files for a specific branch
5
6 prev_HEAD="$1"
7 new_HEAD="$2"
8 new_branch="$3"
9
10 if [ \( "$new_branch" = 1 \) ]; then
11    if [ "$new_HEAD" = "`git rev-parse phd-pubkey`" ]; then
12       git clean -d -f -q
13    else
14       python2.7 -m compileall -q . &&
15       python2.7 -O -m compileall -q .
16    fi
17 fi
18
19 exit 0