From 9763d4123ed8375ce235041e1d368c17c5a473b3 Mon Sep 17 00:00:00 2001 From: TsT Date: Tue, 30 Dec 2014 01:53:08 +0100 Subject: [PATCH] Allow require"Quickie.init" Need for Lua 5.1 package.path contains ./?/init.lua by default with Lua 5.2+ --- init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 11c5e92..42f20ca 100644 --- a/init.lua +++ b/init.lua @@ -24,8 +24,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]]-- -local BASE = (...) .. '.' -assert(not BASE:match('%.init%.$'), "Invalid require path `"..(...).."' (drop the `.init').") +local BASE = (... or ''):gsub('%.init$', '') + +assert(not BASE:match('%.init$'), "Invalid require path `"..(... or '').."' (drop the `.init').") +BASE = BASE.."." return { core = require(BASE .. 'core'),