mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 03:25:23 +09:00
Fixed Existing Lua Check Errors
This commit is contained in:
14
control.lua
14
control.lua
@@ -22,23 +22,23 @@ log('[INFO] Getting file loader config')
|
||||
local files = require 'config._file_loader' --- @dep config._file_loader
|
||||
|
||||
-- Loads all files from the config and logs that they are loaded
|
||||
local total_file_count = string.format('%3d',#files)
|
||||
local total_file_count = string.format('%3d', #files)
|
||||
local errors = {}
|
||||
for index,path in pairs(files) do
|
||||
for index, path in pairs(files) do
|
||||
|
||||
-- Loads the next file in the list
|
||||
log(string.format('[INFO] Loading file %3d/%s (%s)',index,total_file_count,path))
|
||||
local success,file = pcall(require,path)
|
||||
log(string.format('[INFO] Loading file %3d/%s (%s)', index, total_file_count, path))
|
||||
local success, file = pcall(require, path)
|
||||
|
||||
-- Error Checking
|
||||
if not success then
|
||||
-- Failed to load a file
|
||||
log('[ERROR] Failed to load file: '..path)
|
||||
table.insert(errors,'[ERROR] '..path..' :: '..file)
|
||||
table.insert(errors, '[ERROR] '..path..' :: '..file)
|
||||
elseif type(file) == 'string' and file:find('not found') then
|
||||
-- Returned a file not found message
|
||||
log('[ERROR] File not found: '..path)
|
||||
table.insert(errors,'[ERROR] '..path..' :: Not Found')
|
||||
table.insert(errors, '[ERROR] '..path..' :: Not Found')
|
||||
end
|
||||
|
||||
end
|
||||
@@ -49,5 +49,5 @@ require 'overrides.require'
|
||||
|
||||
-- Logs all errors again to make it make it easy to find
|
||||
log('[INFO] All files loaded with '..#errors..' errors:')
|
||||
for _,error in pairs(errors) do log(error) end
|
||||
for _, error in pairs(errors) do log(error) end
|
||||
log('[END] -----| Explosive Gaming Scenario Loader |-----')
|
||||
Reference in New Issue
Block a user