From 0c2e737c18ca3ece17a1c23a0ed6b373c481ab9b Mon Sep 17 00:00:00 2001 From: rwxrob Date: Mon, 18 Apr 2022 11:34:38 -0400 Subject: [PATCH] Add homedir to markfunc.go --- z/markfunc.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/z/markfunc.go b/z/markfunc.go index 05e5dcb..61e0d41 100644 --- a/z/markfunc.go +++ b/z/markfunc.go @@ -31,6 +31,7 @@ var markFuncMap = template.FuncMap{ "execonfdir": execonfdir, "cachedir": cachedir, "confdir": confdir, + "homedir": homedir, } func indent(n int, in string) string { @@ -47,6 +48,13 @@ func confdir() string { return dir } +func homedir(a ...string) string { + dir, _ := os.UserHomeDir() + extra := filepath.Join(a...) + path := filepath.Join(dir, extra) + return path +} + func exepath() string { return ExePath } func exename() string { return ExeName }