mirror of
https://github.com/TangentFoxy/love-release.git
synced 2025-07-28 02:52:20 +00:00
This issue was related to Lua not handling coroutines iterators right, the function being recursive generated multiple coroutine iterators and they didn't resume right. The solution is to make the first loop non-recursive and create a secondary loop where the recursive function is called.
This commit is contained in:
committed by
Antonin Décimo
parent
339cbe7b42
commit
7d5532ebe4
@@ -62,20 +62,25 @@ end
|
||||
-- @local
|
||||
local _buildFileTree
|
||||
_buildFileTree = function(dir)
|
||||
local subDir
|
||||
local subDirs = {}
|
||||
|
||||
for file in assert(fs.dir()) do
|
||||
if not file:find("^%.git") then
|
||||
if fs.is_dir(file) then
|
||||
subDir = {}
|
||||
dir[file] = subDir
|
||||
assert(fs.change_dir(file))
|
||||
_buildFileTree(subDir, file)
|
||||
assert(fs.pop_dir())
|
||||
subDirs[#subDirs + 1] = file
|
||||
elseif fs.is_file(file) then
|
||||
dir[#dir+1] = file
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, path in ipairs(subDirs) do
|
||||
local newDir = {}
|
||||
dir[path] = newDir
|
||||
assert(fs.change_dir(path))
|
||||
_buildFileTree(newDir)
|
||||
assert(fs.pop_dir())
|
||||
end
|
||||
end
|
||||
|
||||
--- Recursive function to check if file should be excluded based
|
||||
|
Reference in New Issue
Block a user