Skip to content

Commit dc95dbf

Browse files
committed
chore(build): add publish script
1 parent 8f88150 commit dc95dbf

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
},
66
"scripts": {
77
"build": "./node_modules/.bin/gitbook build && ./node_modules/.bin/gitbook pdf && ./node_modules/.bin/gitbook mobi && ./node_modules/.bin/gitbook epub",
8-
"build-pdf": "./node_modules/.bin/gitbook pdf"
8+
"build-pdf": "./node_modules/.bin/gitbook pdf",
9+
"publish": "./publish.sh"
910
}
1011
}

publish.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
rm -rf ./_book
4+
gitbook build
5+
mkdir ./_book/ebook
6+
gitbook pdf ./ ./_book/ebook/React模式.pdf
7+
gitbook mobi ./ ./_book/ebook/React模式.mobi
8+
gitbook epub ./ ./_book/ebook/React模式.epub
9+
git checkout gh-pages
10+
git pull origin gh-pages
11+
cp -rf ./_book/* ./
12+
git add .
13+
git commit -m 'chore(docs): regenerated book'
14+
git push origin gh-pages
15+
git checkout master

0 commit comments

Comments
 (0)