2014-08-11 08:26:54 +08:00
|
|
|
#!/bin/bash
|
2013-05-04 04:08:54 +08:00
|
|
|
|
2014-07-25 05:45:12 +08:00
|
|
|
if [[ "$(basename $0)" == "post-merge" ]]; then
|
|
|
|
PREVIOUS_HEAD=ORIG_HEAD
|
|
|
|
else
|
|
|
|
PREVIOUS_HEAD=$1
|
|
|
|
fi
|
|
|
|
|
2015-09-17 02:38:06 +08:00
|
|
|
# if style changed (and less available), rebuild sourcemaps
|
|
|
|
if [[
|
|
|
|
! -z "$(git diff $PREVIOUS_HEAD notebook/static/*/js/**.js)"
|
|
|
|
]]; then
|
|
|
|
echo "rebuilding javascript"
|
|
|
|
python setup.py js || echo "fail to rebuild javascript"
|
|
|
|
fi
|
|
|
|
|
2014-07-24 05:55:58 +08:00
|
|
|
if [[
|
2015-09-17 02:38:06 +08:00
|
|
|
! -z "$(git diff $PREVIOUS_HEAD notebook/static/*/less/**.less)"
|
2014-07-24 05:55:58 +08:00
|
|
|
]]; then
|
2015-09-17 02:38:06 +08:00
|
|
|
echo "rebuilding css sourcemaps"
|
|
|
|
python setup.py css || echo "fail to recompile css"
|
2014-07-24 05:55:58 +08:00
|
|
|
fi
|