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:
TsT 2014-12-30 01:53:08 +01:00
parent 93eb5385d9
commit 9763d4123e

View file

@ -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'),