File: pre-commit

package info (click to toggle)
writeroom-mode 3.11-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 324 kB
  • sloc: lisp: 442; sh: 15; makefile: 4
file content (26 lines) | stat: -rwxr-xr-x 585 bytes parent folder | download | duplicates (2)
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