Mod: raise an error if the mod does not exist
This commit is contained in:
@@ -23,6 +23,7 @@ function Mod.getInfo(modname)
|
|||||||
local name = modname or core.get_current_modname()
|
local name = modname or core.get_current_modname()
|
||||||
local shortName = getShortModName(name)
|
local shortName = getShortModName(name)
|
||||||
local path = core.get_modpath(name)
|
local path = core.get_modpath(name)
|
||||||
|
assert(path ~= nil, ('A mod `%s` does not exist.'):format(name))
|
||||||
local require = Require.getModRequire(name, path)
|
local require = Require.getModRequire(name, path)
|
||||||
|
|
||||||
return {name = name, shortName = shortName, path = path, require = require}
|
return {name = name, shortName = shortName, path = path, require = require}
|
||||||
|
|||||||
Reference in New Issue
Block a user