Ignore .name directories and files
Signed-off-by: Craig Robbins <kde.psych@gmail.com>
This commit is contained in:
parent
9806ede6a3
commit
e98bb3edcc
|
@ -17,30 +17,32 @@
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
function get_mods(path,retval,modpack)
|
||||
local mods = core.get_dirlist(path, true)
|
||||
|
||||
for i=1, #mods, 1 do
|
||||
if mods[i]:sub(1,1) ~= "." then
|
||||
local toadd = {}
|
||||
local modpackfile = nil
|
||||
|
||||
local mods = core.get_dirlist(path,true)
|
||||
for i=1,#mods,1 do
|
||||
local toadd = {}
|
||||
local modpackfile = nil
|
||||
toadd.name = mods[i]
|
||||
toadd.path = path .. DIR_DELIM .. mods[i] .. DIR_DELIM
|
||||
if modpack ~= nil and
|
||||
modpack ~= "" then
|
||||
toadd.modpack = modpack
|
||||
else
|
||||
local filename = path .. DIR_DELIM .. mods[i] .. DIR_DELIM .. "modpack.txt"
|
||||
local error = nil
|
||||
modpackfile,error = io.open(filename,"r")
|
||||
end
|
||||
|
||||
toadd.name = mods[i]
|
||||
toadd.path = path .. DIR_DELIM .. mods[i] .. DIR_DELIM
|
||||
if modpack ~= nil and
|
||||
modpack ~= "" then
|
||||
toadd.modpack = modpack
|
||||
else
|
||||
local filename = path .. DIR_DELIM .. mods[i] .. DIR_DELIM .. "modpack.txt"
|
||||
local error = nil
|
||||
modpackfile,error = io.open(filename,"r")
|
||||
end
|
||||
|
||||
if modpackfile ~= nil then
|
||||
modpackfile:close()
|
||||
toadd.is_modpack = true
|
||||
table.insert(retval,toadd)
|
||||
get_mods(path .. DIR_DELIM .. mods[i],retval,mods[i])
|
||||
else
|
||||
table.insert(retval,toadd)
|
||||
if modpackfile ~= nil then
|
||||
modpackfile:close()
|
||||
toadd.is_modpack = true
|
||||
table.insert(retval,toadd)
|
||||
get_mods(path .. DIR_DELIM .. mods[i],retval,mods[i])
|
||||
else
|
||||
table.insert(retval,toadd)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -31,11 +31,13 @@ local function render_texture_pack_list(list)
|
|||
local retval = ""
|
||||
|
||||
for i, v in ipairs(list) do
|
||||
if retval ~= "" then
|
||||
retval = retval ..","
|
||||
end
|
||||
if v:sub(1,1) ~= "." then
|
||||
if retval ~= "" then
|
||||
retval = retval ..","
|
||||
end
|
||||
|
||||
retval = retval .. core.formspec_escape(v)
|
||||
retval = retval .. core.formspec_escape(v)
|
||||
end
|
||||
end
|
||||
|
||||
return retval
|
||||
|
|
Loading…
Reference in New Issue