forked from cocos2d/cocos2d-x-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·82 lines (63 loc) · 2.22 KB
/
build.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
#!/bin/sh
# This script builds: Cocos2d-x-docs, Cocos Creator Manual, Cocos Creator API-Ref.
echo "-----------------"
echo "Cocos2d-x-docs..."
echo "-----------------"
# First Cocos2d-x docs, we are aready in this repo when executing this script
## pull latest from github
echo "Cocos2d-x-docs -- pulling latest from GitHub..."
git pull origin master
## build it
echo "Cocos2d-x-docs -- building GitBook docs...."
gitbook build
## copy some needed files
echo "Cocos2d-x-docs -- copying needed files..."
cp index.html.en _book/index.html
cp ../api-refs-static-pages.tar.gz _book/.
cp ../editors_and_tools.tar.gz _book/.
## copy everything to deployment directory
cd _book/
echo "Cocos2d-x-docs -- extracting everything..."
tar xvf api-refs-static-pages.tar.gz
tar xvf editors_and_tools.tar.gz
echo "Cocos2d-x-docs -- removing unneeded files..."
rm -rf api-refs-static-pages.tar.gz
rm -rf editors_and_tools.tar.gz
cd ..
mv _book/ cocos2d-x/
mv cocos2d-x ../documentation/
#echo "Cocos2d-x-docs -- copy everything to deployment directory..."
#cp -R api-ref editors_and_tools en gitbook index.html package.json #search_plus_index.json zh ../../documentation/
rm -rf cocos2d-x/
echo "-----------------------"
echo "Cocos Creator Manual..."
echo "-----------------------"
## pull latest from github
echo "Cocos Creator -- pulling latest from GitHub..."
cd ../creator-docs
git pull origin cocos2d-x.org
## build it
echo "Cocos Creator -- building GitBook docs...."
gitbook build
## copy everything to deployment directory
echo "Cocos Creator -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/index.html.en _book/index.html
mv _book/ creator/
mv creator ../documentation/
rm -rf creator/
echo "------------------------"
echo "Cocos Creator API-Ref..."
echo "------------------------"
## pull latest from github
echo "Cocos Creator API -- pulling latest from GitHub..."
cd ../creator-api-docs
git pull origin cocos2d-x.org
## build it
echo "Cocos Creator API -- building GitBook docs...."
gitbook build
## copy everything to deployment directory
echo "Cocos Creator API -- copy everything to deployment directory..."
cp ../cocos2d-x-docs/index.html.en _book/index.html
mv _book/ creator-api/
mv creator-api ../documentation/
rm -rf creator-api/