aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Mr <almr.oss@outlook.com>2024-05-02 19:46:10 +0000
committerFlorian Fischer <florian.fischer@muhq.space>2024-05-03 08:29:10 +0200
commite3e6ac024639feda5ff8743f8a968e5d1eb2fd64 (patch)
tree793b7366b4c45553c692020c2129147fa6552f0b
parentf92cb0ef715867016ff33cbe4d5f621b3c1c85bd (diff)
downloadvis-lockfiles-e3e6ac024639feda5ff8743f8a968e5d1eb2fd64.tar.gz
vis-lockfiles-e3e6ac024639feda5ff8743f8a968e5d1eb2fd64.zip
init.lua: re-expand whenever M.directory changes
-rw-r--r--init.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 2481a14..6cc5ebd 100644
--- a/init.lua
+++ b/init.lua
@@ -14,7 +14,7 @@
-- If not, see <https://www.gnu.org/licenses/>.
local M = {}
M.directory = '${XDG_STATE_HOME:-${HOME}/.local/state}/vis/locks'
-M.directory_expanded = false
+M.directory_expanded = nil
-- Helper to execute a command and capture its output
local function capture_cmd(cmd)
@@ -29,8 +29,9 @@ local function capture_cmd(cmd)
end
local function get_lock_dir()
- if not M.directory_expanded then
+ if M.directory_expanded ~= M.directory then
M.directory = capture_cmd('printf %s "' .. M.directory .. '"')
+ M.directory_expanded = M.directory
end
return M.directory
end