Skip to content

Commit 340a8ff

Browse files
committed
attempt to regen source maps in git-hooks
if css changes
1 parent e0ab409 commit 340a8ff

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

git-hooks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ git hooks for IPython
33
add these to your `.git/hooks`
44

55
For now, we just have `post-checkout` and `post-merge`,
6-
both of which just update submodules,
6+
both of which update submodules and attempt to rebuild css sourcemaps,
77
so make sure that you have a fully synced repo whenever you checkout or pull.
88

99
To use these hooks, run `./install-hooks.sh`.

git-hooks/post-checkout

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,16 @@
22

33
git submodule init
44
git submodule update
5+
6+
PREVIOUS_HEAD=$1
7+
# if style changed (and less/fabric available), rebuild sourcemaps
8+
if [[
9+
! -z "$(git diff $PREVIOUS_HEAD IPython/html/static/style/ipython.min.css)"
10+
&& ! -z "$(git diff $PREVIOUS_HEAD IPython/html/static/style/style.min.css)"
11+
&& ! -z $(which 2>/dev/null lessc)
12+
&& ! -z $(which 2>/dev/null fab)
13+
]]; then
14+
echo "rebuilding sourcemaps"
15+
cd IPython/html
16+
fab css
17+
fi

git-hooks/post-merge

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,16 @@
22

33
git submodule init
44
git submodule update
5+
6+
PREVIOUS_HEAD=$1
7+
# if style changed (and less/fabric available), rebuild sourcemaps
8+
if [[
9+
! -z "$(git diff $PREVIOUS_HEAD IPython/html/static/style/ipython.min.css)"
10+
&& ! -z "$(git diff $PREVIOUS_HEAD IPython/html/static/style/style.min.css)"
11+
&& ! -z $(which 2>/dev/null lessc)
12+
&& ! -z $(which 2>/dev/null fab)
13+
]]; then
14+
echo "rebuilding sourcemaps"
15+
cd IPython/html
16+
fab css
17+
fi

0 commit comments

Comments
 (0)