Build: Fix command line arguments being ignored if config.lua loading failed
Former-commit-id: a0b9389550d838dbb1257ad68f190f1191bf1987 [formerly 6888f45b376814ff8cea69054c87110b0842bae4] Former-commit-id: 13522b14991d0e08341798d29344b6e5d6f0a9bd
This commit is contained in:
parent
70ee053f3f
commit
b2351e6ef2
|
|
@ -637,26 +637,23 @@ end
|
|||
|
||||
function NazaraBuild:LoadConfig()
|
||||
local f = io.open("config.lua", "r")
|
||||
if (not f) then
|
||||
print("Failed to open config.lua")
|
||||
return
|
||||
end
|
||||
|
||||
if (f) then
|
||||
local content = f:read("*a")
|
||||
f:close()
|
||||
|
||||
local func, err = loadstring(content)
|
||||
if (not func) then
|
||||
print("Failed to parse config.lua: " .. err)
|
||||
return
|
||||
end
|
||||
|
||||
if (func) then
|
||||
setfenv(func, self.Config)
|
||||
|
||||
local status, err = pcall(func)
|
||||
if (not status) then
|
||||
print("Failed to load config.lua: " .. err)
|
||||
return
|
||||
end
|
||||
else
|
||||
print("Failed to parse config.lua: " .. err)
|
||||
end
|
||||
else
|
||||
print("Failed to open config.lua")
|
||||
end
|
||||
|
||||
local configTable = self.Config
|
||||
|
|
|
|||
Loading…
Reference in New Issue