bin/setup-man

Wed, 22 Sep 2021 16:34:57 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 22 Sep 2021 16:34:57 -0400
changeset 946
20c0492da189
parent 756
8bc91181db9d
permissions
-rwxr-xr-x

Add sick "run anywhere ignoring bundler" hacks

756
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 #!/bin/sh
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 set -eu
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 cd $(hg root)
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 SOURCES="${@:-$(hg stat -Aqn -I 'bin/*')}"
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 MAN1=".man/man1"
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 mkdir -p $MAN1 || true
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11 for SRC in $(grep -El '^=(head|cut)' $SOURCES); do
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 DST="${MAN1}/$(basename $SRC).1"
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 if [ ! -f $DST ] || [ "$SRC" -nt "$SRC" ]; then
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 pod2man -v --errors=stderr "$SRC" "$DST"
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 fi
8bc91181db9d add setup-man
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
16 done

mercurial