代码拉取完成,页面将自动刷新
#!/bin/bash
cd doc
# gitbook install
# install the plugins and build the static site
gitbook build
cd ..
# checkout to the gh-pages branch
git checkout gh-pages
# pull the latest updates
git pull origin gh-pages
if [[ "$?" != "0" ]]; then
exit 1
fi
# copy the static site files into the current directory.
\cp -Rf doc/_book/* .
# remove 'node_modules' and '_book' directory
# git clean -fx gitbook/node_modules
# git clean -fx gitbook/_book
rm -rf doc/_book/
# remove website css files, except last one
ccount=`ls website-* | wc -w`
if [[ "$ccount" > 1 ]];then
allcss=($(ls website-*))
c=0
for css in "${allcss[@]}"; do
let "c=c+1"
if [[ $c -ge $ccount ]]; then
break;
fi
rm -f $css
done
fi
# add all files
git add --all
# commit
git commit -a -m "Update docs"
# push to the origin
git push origin gh-pages
# checkout to the master branch
git checkout master
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。