summaryrefslogtreecommitdiff
path: root/script/filewatch.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/filewatch.lua')
-rw-r--r--script/filewatch.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/script/filewatch.lua b/script/filewatch.lua
index 28f7376f..dd46d1a3 100644
--- a/script/filewatch.lua
+++ b/script/filewatch.lua
@@ -8,11 +8,14 @@ local RENAME = 1 << 1
local function exists(filename)
local path = fs.path(filename)
local suc, res = pcall(fs.exists, path)
- if suc and res then
- return true
- else
+ if not suc or not res then
return false
end
+ suc, res = pcall(fs.canonical, path)
+ if not suc or res:string() ~= path:string() then
+ return false
+ end
+ return true
end
---@class filewatch