2017-11-21 19:05:06 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
START=`date "+%F %T"`
|
|
|
|
|
|
|
|
if [ $1 = "sh" ];then sh ; exit 0; fi
|
|
|
|
|
|
|
|
rm -rf node_modules _book
|
|
|
|
|
2019-08-31 18:36:00 +08:00
|
|
|
srcDir=$PWD
|
2017-11-21 19:05:06 +08:00
|
|
|
|
2019-08-31 18:36:00 +08:00
|
|
|
cp -a . /srv/gitbook
|
|
|
|
|
|
|
|
cd /srv/gitbook
|
2017-11-21 19:05:06 +08:00
|
|
|
|
|
|
|
main(){
|
2019-09-01 20:05:43 +08:00
|
|
|
if [ "$1" = build ];then
|
|
|
|
gitbook build && cp -a _book $srcDir && echo $START && date "+%F %T" && exit 0
|
|
|
|
else
|
|
|
|
exec gitbook serve
|
|
|
|
fi
|
2017-11-21 19:05:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
main $1 $2 $3
|