allow datadir and viewdir to be set via env. from klimpong
Ted Unangst tedu@tedunangst.com
Mon, 11 Mar 2024 22:21:12 -0400
3 files changed,
13 insertions(+),
2 deletions(-)
M
docs/honk.8
→
docs/honk.8
@@ -62,11 +62,15 @@ The root data directory, where the database and other user data are stored.
This directory contains all user data that persists across upgrades. Requires write access. Defaults to ".". +Also set by +.Ev HONK_DATADIR . .It Fl viewdir Ar dir The root view directory, where html and other templates are stored. The contents of this directory are generally replaced with each release. Read only. Defaults to ".". +Also set by +.Ev HONK_VIEWDIR . .El .Pp The following options control log output.
M
main.go
→
main.go
@@ -103,8 +103,8 @@ callback: func(args []string) {
usage() }, } - flag.StringVar(&dataDir, "datadir", dataDir, "data directory") - flag.StringVar(&viewDir, "viewdir", viewDir, "view directory") + flag.StringVar(&dataDir, "datadir", getenv("HONK_DATADIR", dataDir), "data directory") + flag.StringVar(&viewDir, "viewdir", getenv("HONK_VIEWDIR", viewDir), "view directory") flag.Usage = usage flag.Parse()