1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/bin/bash
if [ ! "$(git status --porcelain README.md)" == 'M README.md' ] ; then
exit 0 # everything's fine
fi
# otherwise generate info file and git-add it.
git stash -q --keep-index
pandoc --read=markdown \
--write=texinfo \
--output=/home/joost/src/writeroom-mode/writeroom-mode.texi \
--include-before-body=/home/joost/src/writeroom-mode/texi-before-body \
--standalone \
./README.md
RESULT=$?
[ $RESULT == 0 ] && makeinfo ./writeroom-mode.texi && git add ./writeroom-mode.info
git stash pop -q
[ $RESULT -ne 0 ] && exit 1
exit 0
|