chore: Check source file exists before comparing timestamps (#375)

This commit is contained in:
Caleb Maclennan 2022-06-17 13:41:29 +03:00 committed by GitHub
parent 38b1537d1f
commit 71dd5edbda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -230,7 +230,9 @@ function M.check_directory(d)
end
function M.check_file (f,original)
if not path.exists(f) or path.getmtime(original) > path.getmtime(f) then
if not path.exists(f)
or not path.exists(original)
or path.getmtime(original) > path.getmtime(f) then
local text,err = utils.readfile(original)
local _
if text then