elua: enable module lookups in apps location
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Tue, 19 Jul 2016 15:19:42 +0000 (16:19 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Tue, 19 Jul 2016 15:19:42 +0000 (16:19 +0100)
This will allow for better organization of the docgen script.

src/lib/elua/elua.c
src/scripts/elua/core/module.lua

index 606d04e..f537663 100644 (file)
@@ -499,7 +499,7 @@ _elua_module_system_init(lua_State *L)
    const char       *modpath  = es->moddir;
    const char       *appspath = es->appsdir;
    Eina_Stringshare *data     = NULL;
-   int n = 3;
+   int n = 4;
    if (!corepath || !modpath || !appspath)
      return 0;
    lua_pushvalue(L, 1);
@@ -515,6 +515,7 @@ _elua_module_system_init(lua_State *L)
      }
    lua_pushfstring(L, "%s/?.eo.lua;", modpath);
    lua_pushfstring(L, "%s/?.lua;", modpath);
+   lua_pushfstring(L, "%s/?.lua;", appspath);
    lua_pushvalue(L, 3);
    lua_concat(L, n + 1);
    lua_pushfstring(L, "%s/?.lua;", appspath);
index 0415480..fdaca55 100644 (file)
@@ -17,7 +17,7 @@ M.preload = preload
 
 for k, v in pairs(package.loaded) do loaded[k] = v end
 
-M.path  = "./?.lua;/?/init.lua"
+M.path  = "./?.lua;./?/init.lua"
 M.cpath = ""
 M.apath = "./?.lua"