This repository has been archived by the owner on Jun 15, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
52 lines (46 loc) · 1.64 KB
/
run.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
# find main brushes / themes repos
MAIN_BRUSHES=""
MAIN_THEMES=""
for folder in repos/*/; do
basefolder=$(basename "$folder")
if [ $(expr substr ${basefolder} 1 6) = "brush-" ]; then
MAIN_BRUSHES="$MAIN_BRUSHES,$(echo ${basefolder} | cut -c 7-)"
fi
if [ ${basefolder} != "theme-base" -a $(expr substr ${basefolder} 1 6) = "theme-" ]; then
MAIN_THEMES="$MAIN_THEMES $(echo ${basefolder} | cut -c 7-)"
fi
done
# custom brushes
CUSTOM_BRUSHES=""
while IFS= read -r line; do
brush_repo=$(echo ${line} | cut -f1 -d,)
brush_name=$(echo ${line} | cut -f2 -d,)
brush_js=$(echo ${line} | cut -f3 -d,)
git clone ${brush_repo} repos/brush-${brush_name}
CUSTOM_BRUSHES="$CUSTOM_BRUSHES,repos/brush-${brush_name}/${brush_js}"
done < "/customBrushes.txt"
# custom themes
CUSTOM_THEMES=""
while IFS= read -r line; do
theme_repo=$(echo ${line} | cut -f1 -d,)
theme_name=$(echo ${line} | cut -f2 -d,)
theme_css=$(echo ${line} | cut -f3 -d,)
git clone ${theme_repo} repos/theme-${theme_name}
CUSTOM_THEMES="$CUSTOM_THEMES repos/theme-${theme_name}/${theme_css}"
done < "/customThemes.txt"
# display
BRUSHES=$(echo "${MAIN_BRUSHES}${CUSTOM_BRUSHES}" | cut -c 2- | xargs)
THEMES=$(echo "${MAIN_THEMES} ${CUSTOM_THEMES}" | xargs)
echo "========================="
echo "Brushes: $BRUSHES"
echo "========================="
echo "Themes: $THEMES"
echo "========================="
# https://github.com/syntaxhighlighter/syntaxhighlighter/wiki/Building#building-syntaxhighlighterjs
for theme in ${THEMES}; do
gulp build --theme=${theme} --compat
mv "dist/theme.css" "dist/theme-$theme.css"
done
gulp build --brushes=${BRUSHES} --compat
ls -al dist/