mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +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)
|
table.insert(dirs, dir.. "/" ..v)
|
||||||
else
|
else
|
||||||
local parts = loveframes.util.SplitString(v, "([.])")
|
local parts = loveframes.util.SplitString(v, "([.])")
|
||||||
local extension = parts[#parts]
|
local extension = #parts > 1 and parts[#parts]
|
||||||
parts[#parts] = nil
|
if #parts > 1 then
|
||||||
local name = table.concat(parts)
|
parts[#parts] = nil
|
||||||
|
end
|
||||||
|
local name = table.concat(parts, ".")
|
||||||
table.insert(t, {
|
table.insert(t, {
|
||||||
path = dir,
|
path = dir,
|
||||||
fullpath = dir.. "/" ..v,
|
fullpath = dir.. "/" ..v,
|
||||||
@ -160,10 +162,8 @@ function loveframes.util.GetDirectoryContents(dir, t)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if #dirs > 0 then
|
for k, v in ipairs(dirs) do
|
||||||
for k, v in ipairs(dirs) do
|
t = loveframes.util.GetDirectoryContents(v, t)
|
||||||
t = loveframes.util.GetDirectoryContents(v, t)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return t
|
return t
|
||||||
|
Loading…
Reference in New Issue
Block a user