mirror of
https://github.com/jupyter/notebook.git
synced 2024-11-21 01:11:21 +08:00
parent
cc32f165e8
commit
eaa3c0ac36
@ -1,10 +1,9 @@
|
||||
git hooks for IPython
|
||||
git hooks for Jupyter
|
||||
|
||||
add these to your `.git/hooks`
|
||||
|
||||
For now, we just have `post-checkout` and `post-merge`,
|
||||
both of which update submodules and attempt to rebuild css sourcemaps,
|
||||
both of which attempt to rebuild javascript and css sourcemaps,
|
||||
so make sure that you have a fully synced repo whenever you checkout or pull.
|
||||
|
||||
To use these hooks, run `./install-hooks.sh`.
|
||||
If you havn't initialised and updated the submodules manually, you will then need to run `git checkout master` to activate the hooks (even if you already have `master` checked out).
|
||||
To use these hooks, run `./install-hooks.sh`.
|
||||
|
@ -1,22 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
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/invoke available), rebuild sourcemaps
|
||||
# if style changed (and less 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 invoke)
|
||||
! -z "$(git diff $PREVIOUS_HEAD notebook/static/*/js/**.js)"
|
||||
]]; then
|
||||
echo "rebuilding sourcemaps"
|
||||
cd IPython/html
|
||||
invoke css || echo "failed to compile css"
|
||||
echo "rebuilding javascript"
|
||||
python setup.py js || echo "fail to rebuild javascript"
|
||||
fi
|
||||
|
||||
if [[
|
||||
! -z "$(git diff $PREVIOUS_HEAD notebook/static/*/less/**.less)"
|
||||
]]; then
|
||||
echo "rebuilding css sourcemaps"
|
||||
python setup.py css || echo "fail to recompile css"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user