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