notebook/git-hooks/post-checkout
MinRK 7372aa8110 minor tweak to git hooks
- fix PREVIOUS_HEAD when run as git-merge
- catch fab css failure
2014-07-24 14:45:12 -07:00

23 lines
559 B
Bash
Executable File

#!/bin/sh
git submodule init
git submodule update
if [[ "$(basename $0)" == "post-merge" ]]; then
PREVIOUS_HEAD=ORIG_HEAD
else
PREVIOUS_HEAD=$1
fi
# if style changed (and less/fabric available), rebuild sourcemaps
if [[
! -z "$(git diff $PREVIOUS_HEAD IPython/html/static/style/ipython.min.css)"
&& ! -z "$(git diff $PREVIOUS_HEAD IPython/html/static/style/style.min.css)"
&& ! -z $(which 2>/dev/null lessc)
&& ! -z $(which 2>/dev/null fab)
]]; then
echo "rebuilding sourcemaps"
cd IPython/html
fab css || echo "failed to compile css"
fi