Quantcast
Channel: Active questions tagged require - Stack Overflow
Viewing all articles
Browse latest Browse all 144

Load Lua-files by relative path

$
0
0

If I have a file structure like this:

./main.lua./mylib/mylib.lua./mylib/mylib-utils.lua./mylib/mylib-helpers.lua./mylib/mylib-other-stuff.lua

From main.lua the file mylib.lua can be loaded with full path require('mylib.mylib'). But inside mylib.lua I would also like to load other necessary modules and I don't feel like always specifying the full path (e.g. mylib.mylib-utils). If I ever decide to move the folder I'm going to have a lot of search and replace. Is there a way to use just the relative part of the path?

UPD. I'm using Lua with Corona SDK, if that matters.


Viewing all articles
Browse latest Browse all 144

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>