From d25c34b2e12c9cf87191a7c80f512ec25614322c Mon Sep 17 00:00:00 2001 From: Paul Liverman III Date: Fri, 16 Mar 2018 20:12:48 -0700 Subject: [PATCH] corrected call metamethod --- init.moon | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/init.moon b/init.moon index 6ff26b9..7cce093 100644 --- a/init.moon +++ b/init.moon @@ -107,11 +107,11 @@ registry = setmetatable {}, { return setmetatable { :locate, :autoload, :make_migrations, :registry }, { - __call: (t, here="") -> - if "init" == here\sub -4 - here = here\sub 1, -6 - unless here\len! > 0 - here = "" + __call: (t, here) -> + if here and here\find "%." + here = here\sub 1, here\len! - here\match(".*%.(.+)")\len! - 1 + else + here = nil return autoload here __index: (t, name) ->