From bd3b8b810c21559a748a25390a1312d17d9d9b6c Mon Sep 17 00:00:00 2001 From: hkc Date: Thu, 21 Dec 2023 21:47:32 +0300 Subject: [PATCH] Now it works with relative paths --- runonchange.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runonchange.lua b/runonchange.lua index da7ef93..add2907 100644 --- a/runonchange.lua +++ b/runonchange.lua @@ -18,10 +18,13 @@ if #args == 0 then return end +local curdir = shell.dir() + while true do local shall_run = false for name, modtime in pairs(modtimes) do - local modtime_new = fs.attributes(name).modified + local path = name:sub(1,1) == "/" and name or (curdir .. "/" .. name) + local modtime_new = fs.attributes(path).modified if modtime_new ~= modtime then shall_run = true modtimes[name] = modtime_new