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)
|
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]
|
||||||
|
if #parts > 1 then
|
||||||
parts[#parts] = nil
|
parts[#parts] = nil
|
||||||
local name = table.concat(parts)
|
end
|
||||||
|
local name = table.concat(parts, ".")
|
||||||
table.insert(t, {
|
table.insert(t, {
|
||||||
path = dir,
|
path = dir,
|
||||||
fullpath = dir.. "/" ..v,
|
fullpath = dir.. "/" ..v,
|
||||||
@ -160,11 +162,9 @@ 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