mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
Minor improvements to loveframes.util.GetDirecoryContents
This commit is contained in:
parent
98c47eb9f9
commit
7f8963b3e1
@ -147,9 +147,11 @@ function loveframes.util.GetDirectoryContents(dir, t)
|
||||
table.insert(dirs, dir.. "/" ..v)
|
||||
else
|
||||
local parts = loveframes.util.SplitString(v, "([.])")
|
||||
local extension = parts[#parts]
|
||||
local extension = #parts > 1 and parts[#parts]
|
||||
if #parts > 1 then
|
||||
parts[#parts] = nil
|
||||
local name = table.concat(parts)
|
||||
end
|
||||
local name = table.concat(parts, ".")
|
||||
table.insert(t, {
|
||||
path = dir,
|
||||
fullpath = dir.. "/" ..v,
|
||||
@ -160,11 +162,9 @@ function loveframes.util.GetDirectoryContents(dir, t)
|
||||
end
|
||||
end
|
||||
|
||||
if #dirs > 0 then
|
||||
for k, v in ipairs(dirs) do
|
||||
t = loveframes.util.GetDirectoryContents(v, t)
|
||||
end
|
||||
end
|
||||
|
||||
return t
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user