-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathrelease.sh
115 lines (66 loc) · 1.52 KB
/
release.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/sh
echo "开始同步数据"
echo "git pull"
git pull
echo "同步数据完成"
echo "同步删除旧目录"
echo "rm -rf content"
rm -rf content
echo "rm -rf docs"
rm -rf docs
echo "推送数据"
echo "git add ."
git add .
echo "git commit -am 'delete docs'"
git commit -am "delete docs"
echo "git push"
git push
echo "旧目录删除完成"
echo "创建content文件夹"
echo "mkdir content"
mkdir content
echo "创建新文件夹完成;开始移动文件"
echo "cp -r *.md ./content"
cp -r *.md ./content
echo "cp -r Chapter* ./content"
cp -r Chapter* ./content
echo "cp -r image ./content"
cp -r image ./content
echo "cp -r file ./content"
cp -r file ./content
echo "cp book.json ./content"
cp book.json ./content
echo "移动文件完成;安装插件"
echo "cd content"
cd content
echo "gitbook install"
gitbook install
if [ "$?" != "0" ] ; then
echo "安装插件失败!退出!" 1>&2
exit 1
fi
echo "插件安装完成;退出"
echo "cd .."
cd ..
echo "开始构建"
echo "npm run build"
npm run build
if [ "$?" != "0" ] ; then
echo "构建失败!退出!" 1>&2
exit 1
fi
echo "构建完成;删除content文件夹"
echo "rm -rf content"
rm -rf content
echo "删除node_modules文件夹"
echo "rm -rf node_modules"
rm -rf node_modules
echo "开始上传新docs文件夹"
echo "git add ."
git add .
echo "git commit -am 'release book'"
git commit -am "release book"
echo "git push"
git push
echo "上传完成"
echo "请查看链接 https://fhfirehuo.github.io/Attacking-Java-Rookie/"