bliss

KISS in Lua
git clone git://bvnf.space/bliss.git
Log | Files | Refs | README | LICENSE

commit 3fc07afa1c88d89179d1015f93a69575f5f0522c
parent 820faf0d72351fc54c301d6e131a657d56ca4673
Author: phoebos <ben@bvnf.space>
Date:   Tue, 18 Jul 2023 02:18:09 +0100

utils.setup: don't accept XDG_CACHE_HOME if 0 length

(even though set)

Diffstat:
Mbliss/utils.lua | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bliss/utils.lua b/bliss/utils.lua @@ -47,7 +47,8 @@ function setup() env.sys_db = env.ROOT .. "/" .. env.pkg_db env.sys_ch = env.ROOT .. "/" .. env.cho_db - env.cac_dir = (os.getenv("XDG_CACHE_HOME") or (os.getenv("HOME") .. "/.cache")) .. "/kiss" + local xdg = os.getenv("XDG_CACHE_HOME") + env.cac_dir = (xdg and #xdg > 0 and xdg or (os.getenv("HOME") .. "/.cache")) .. "/kiss" env.src_dir = env.cac_dir .. "/sources" env.log_dir = env.cac_dir .. "/logs/" .. string.sub(env.time, 1, 10) env.bin_dir = env.cac_dir .. "/bin"