-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpre-commit.hook
More file actions
executable file
·26 lines (23 loc) · 842 Bytes
/
Copy pathpre-commit.hook
File metadata and controls
executable file
·26 lines (23 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
set -e
SYSTEMS=(Mac Windows Linux)
SUFFIXES=(.mac.css .windows.css .linux.css)
if [[ "$1" = "--force" ]] || ! git diff-index --quiet --cached HEAD -- www/style.css.php www/style_mobile_additions.css.php www/theme\* www/ea/\*.css.php www/accordius/\*.css.php ; then
git ls-files --cached HEAD 'www/theme-*' |while read F; do
IN="${F#www/}"
OUTBASE="css/style${IN#theme}"
OUTBASE="${OUTBASE%.php}"
OUTBASE="${OUTBASE%.css}"
OUTBASE="${OUTBASE%-default}"
for N in ${!SYSTEMS[*]}; do
OUT="${OUTBASE}${SUFFIXES[N]}"
git show :www/style.css.php | (cd www; php -- ${SYSTEMS[N]} "$IN" >"$OUT")
git add www/"$OUT"
done
done
for N in ${!SYSTEMS[*]}; do
git add www/css/style${SUFFIXES[N]}
done
git show :www/theme_tweaker.css.php | (cd www; php >css/theme_tweaker.css)
git add www/css/theme_tweaker.css
fi