#!/bin/sh
-cd "`dirname "$0"`" || exit 42
DDIR=/home/user/Notes
if [ "$1" = "" ]; then
# Host
+ cd "`dirname "$0"`" || exit 42
cd ..
rm -f mkdocs/ok
touch mkdocs/wip
[ -e mkdocs/ok ] ; rep=$? ; rm -f mkdocs/ok
if [ $rep = 0 ]; then
echo Copying to remote site...
- echo TODO
+ cd mkdocs/site
+ git add .
+ if [ $? != 0 ]; then
+ echo Failure to add newly built html site >&2
+ exit 20
+ fi
+ git commit -m "`date +"Auto commit %Y-%m-%d %H:%M"`"
+ if [ $? != 0 ]; then
+ echo Failure to commit to git >&2
+ exit 21
+ fi
+ git push nikiroo html
+ if [ $? != 0 ]; then
+ echo Failure to push html branch to nikiroo >&2
+ exit 22
+ fi
else
- echo Failed to update, no remote copy started: $rep
+ echo Failed to update, no remote copy started: $rep >&2
fi
rm -f mkdocs/wip
exit $rep