"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
got-www: don't hardcode directory in sync-man.sh
To:
gameoftrees@openbsd.org
Date:
Mon, 19 Aug 2024 16:35:41 +0200

Download raw body.

Thread
this adds a -w to sync-man.sh so that it's possible to point the script
at different worktree.  (fwiw i have my main checkout in ~/w/got)

ok?

diff /home/op/w/got-www
commit - a7f03a023a07a567655219dcc281a91b7a9a1436
path + /home/op/w/got-www
blob - cde918dd3626cbf72f7bd01e001067bd4078f3c5
file + sync-man.sh
--- sync-man.sh
+++ sync-man.sh
@@ -1,20 +1,29 @@
 #!/bin/sh
 
+workdir="$HOME/src/got"
+
+while getopts w: name; do
+	case $name in
+	w)	workdir="$OPTARG" ;;
+	?)	echo "Usage: $0 [-w workdir]" >&2; exit 1 ;;
+	esac
+done
+
 CONVERT="mandoc -T html -O style=mandoc.css"
 
 for f in got.1 got-worktree.5 git-repository.5 got.conf.5; do
-	$CONVERT $HOME/src/got/got/$f > ./${f}.html
+	$CONVERT "$workdir"/got/$f > ./${f}.html
 done
-$CONVERT $HOME/src/got/gotadmin/gotadmin.1 > ./gotadmin.1.html
-$CONVERT $HOME/src/got/tog/tog.1 > ./tog.1.html
+$CONVERT "$workdir"/gotadmin/gotadmin.1 > ./gotadmin.1.html
+$CONVERT "$workdir"/tog/tog.1 > ./tog.1.html
 for f in gotwebd.8 gotwebd.conf.5; do
-	$CONVERT $HOME/src/got/gotwebd/$f > ./${f}.html
+	$CONVERT "$workdir"/gotwebd/$f > ./${f}.html
 done
 for f in gotd.8 gotd.conf.5; do
-	$CONVERT $HOME/src/got/gotd/$f > ./${f}.html
+	$CONVERT "$workdir"/gotd/$f > ./${f}.html
 done
-$CONVERT $HOME/src/got/gotsh/gotsh.1 > ./gotsh.1.html
-$CONVERT $HOME/src/got/gotctl/gotctl.8 > ./gotctl.8.html
-$CONVERT $HOME/src/got/gitwrapper/gitwrapper.1 > ./gitwrapper.1.html
+$CONVERT "$workdir"/gotsh/gotsh.1 > ./gotsh.1.html
+$CONVERT "$workdir"/gotctl/gotctl.8 > ./gotctl.8.html
+$CONVERT "$workdir"/gitwrapper/gitwrapper.1 > ./gitwrapper.1.html
 
 got st