forked from apachecn/Interview
-
Notifications
You must be signed in to change notification settings - Fork 10
/
run_website.sh
47 lines (36 loc) · 1.49 KB
/
run_website.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
#!/bin/bash
loginfo() { echo "[INFO] $@"; }
logerror() { echo "[ERROR] $@" 1>&2; }
python3 src/script.py "home" "book"
rm -rf node_modules/gitbook-plugin-tbfed-pagefooter
gitbook install
python3 src/script.py "home" "powered"
python3 src/script.py "home" "gitalk"
gitbook build ./ _book
# python3 src/script.py "home" "index"
versions="Algorithm/Leetcode/Python Algorithm/Leetcode/JavaScript"
for version in $versions;do
loginfo "==========================================================="
loginfo "开始", ${version}, "版本编译"
echo "cp book.json docs/${version}"
cp book.json docs/${version}
# 替换 book.json 的编辑地址
echo "python3 src/script.py ${version} book"
python3 src/script.py ${version} "book"
echo "cp -r node_modules docs/${version}"
rm -rf docs/${version}/node_modules
cp -r node_modules docs/${version}
echo "gitbook install docs/${version}"
gitbook install docs/${version}
echo "python3 src/script.py ${version} powered"
python3 src/script.py ${version} "powered"
echo "python3 src/script.py ${version} gitalk"
python3 src/script.py ${version} "gitalk"
echo "gitbook build docs/${version} _book/docs/${version}"
gitbook build docs/${version} _book/docs/${version}
# 注释多余的内容
# echo "python3 src/script.py ${version} index"
# python3 src/script.py ${version} "index"
done
# rm -rf /opt/apache-tomcat-9.0.17/webapps/test_book
# cp -r _book /opt/apache-tomcat-9.0.17/webapps/test_book