Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated for 11.0+ #10

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lurker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ local lurker = { _version = "1.0.1" }


local dir = love.filesystem.enumerate or love.filesystem.getDirectoryItems
local isdir = love.filesystem.isDirectory
local isdir = love.filesystem.getInfo
local time = love.timer.getTime or os.time
local lastmodified = love.filesystem.getLastModified
local lastmodified = love.filesystem.getInfo

local lovecallbacknames = {
"update",
Expand Down Expand Up @@ -62,7 +62,7 @@ function lurker.listdir(path, recursive, skipdotfiles)
local t = {}
for _, f in pairs(lume.map(dir(path), fullpath)) do
if not skipdotfiles or not f:match("/%.[^/]*$") then
if recursive and isdir(f) then
if recursive and isdir(f, "directory") then
t = lume.concat(t, lurker.listdir(f, true, true))
else
table.insert(t, lume.trim(f, "/"))
Expand Down Expand Up @@ -201,7 +201,7 @@ end

function lurker.getchanged()
local function fn(f)
return f:match("%.lua$") and lurker.files[f] ~= lastmodified(f)
return f:match("%.lua$") and lurker.files[f] ~= lastmodified(f).modtime
end
return lume.filter(lurker.listdir(lurker.path, true, true), fn)
end
Expand All @@ -213,7 +213,7 @@ end


function lurker.resetfile(f)
lurker.files[f] = lastmodified(f)
lurker.files[f] = lastmodified(f).modtime
end


Expand Down