1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-11-13 05:19:59 +00:00

Allow having a startup directory and a startup.lua file simultaneously

This commit is contained in:
Lignum 2017-05-10 23:21:04 +02:00
parent 2e7c9b163d
commit 962e419098
No known key found for this signature in database
GPG Key ID: 0889206F5A8A700D

View File

@ -215,12 +215,15 @@ local function findStartups( sBaseDir )
local sStartupNode = shell.resolveProgram( sBasePath )
if sStartupNode then
tStartups = { sStartupNode }
else
if fs.isDir( sBasePath ) then
end
-- It's possible that there is a startup directory and a startup.lua file, so this has to be
-- executed even if a file has already been found.
if fs.isDir( sBasePath ) then
if tStartups == nil then
tStartups = {}
for _,v in pairs( fs.list( sBasePath ) ) do
tStartups[ #tStartups + 1 ] = shell.resolveProgram( "/" .. fs.combine( sBasePath, v ) )
end
end
for _,v in pairs( fs.list( sBasePath ) ) do
tStartups[ #tStartups + 1 ] = shell.resolveProgram( "/" .. fs.combine( sBasePath, v ) )
end
end
return tStartups