Allow require"Quickie.init"
Need for Lua 5.1 package.path contains ./?/init.lua by default with Lua 5.2+
This commit is contained in:
parent
93eb5385d9
commit
9763d4123e
1 changed files with 4 additions and 2 deletions
6
init.lua
6
init.lua
|
@ -24,8 +24,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
local BASE = (...) .. '.'
|
local BASE = (... or ''):gsub('%.init$', '')
|
||||||
assert(not BASE:match('%.init%.$'), "Invalid require path `"..(...).."' (drop the `.init').")
|
|
||||||
|
assert(not BASE:match('%.init$'), "Invalid require path `"..(... or '').."' (drop the `.init').")
|
||||||
|
BASE = BASE.."."
|
||||||
|
|
||||||
return {
|
return {
|
||||||
core = require(BASE .. 'core'),
|
core = require(BASE .. 'core'),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue