From eb5bde52ddb9b2201b462903053f401ed90a33cf Mon Sep 17 00:00:00 2001 From: Christopher Monsanto Date: Fri, 1 May 2020 02:45:27 -0400 Subject: [PATCH] tup-ext: add getconfig helper --- util/tup-ext.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/util/tup-ext.lua b/util/tup-ext.lua index 9f04ed31..15de3f6d 100644 --- a/util/tup-ext.lua +++ b/util/tup-ext.lua @@ -21,6 +21,16 @@ function iglob(pats) return iter(glob(pats)) end +-- getconfig returning an empty string on absence is inconvenient +function getconfig(str) + local v = tup.getconfig(str) + if v == "" then + return nil + else + return v + end +end + function symlink(input, output) -- The path must be relative from output, walk back to the root local prefix = ""