#!/bin/sh # post-checkout hook that compiles python files to byte code # if branch was changed or removes byte code files for a specific branch prev_HEAD="$1" new_HEAD="$2" new_branch="$3" if [ \( "$new_branch" = 1 \) ]; then if [ "$new_HEAD" = "`git rev-parse phd-pubkey`" ]; then git clean -d -f -q else python -m compileall -q -x '\.tox/' . && python -O -m compileall -q -x '\.tox/' . fi fi exit 0