forked from roboticslab-uc3m/installation-guides
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-gitbook.sh
executable file
·23 lines (21 loc) · 941 Bytes
/
update-gitbook.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# Thanks: http://stackoverflow.com/questions/14710257/running-a-cron-job-at-230-am-every-day
# On how to automate process at 2:30 every day (type "date" to get your server time)
# crontab -e
# 30 2 * * * /your/command
echo "Update installation-guides..."
cd $HOME/installation-guides
git pull
echo "Gitbook installation-guides..."
rm -r _book/
# npm install -g gitbook-summary
/usr/local/bin/node /usr/local/bin/book sm -i CONTRIBUTING # Overrides '.*, /_book/', but /_book/ was erased above
# npm install -g gitbook
sed -i "s/\/SUMMARY.md/#\/SUMMARY.md/g" .gitignore
/usr/local/bin/node /usr/local/bin/gitbook build
/usr/local/bin/node /usr/local/bin/gitbook pdf . _book/installation-guides.pdf
/usr/local/bin/node /usr/local/bin/gitbook mobi . _book/installation-guides.mobi
/usr/local/bin/node /usr/local/bin/gitbook epub . _book/installation-guides.epub
sed -i "s/#\/SUMMARY.md/\/SUMMARY.md/g" .gitignore
rm SUMMARY.md
cd ..