-
Notifications
You must be signed in to change notification settings - Fork 111
prequire
wpferguson edited this page Jun 14, 2020
·
1 revision
prequire
a protected lua require
local du = require "lib/dtutils"
local status, lib = du.prequire(req_name)
req_name - string - the filename of the lua code to load without the ".lua" filetype
prequire is a protected require that can survive an error in the code being loaded without bringing down the calling routine.
status - boolean - true on success lib - if status is true, then the code, otherwise an error message
local status, lib = prequire("lib/dtutils.file")
which would load lib/dtutils/file.lua which would return a status of true and the reference to the library.