snaxd change add package.path

This commit is contained in:
Cloud Wu
2014-08-07 19:34:48 +08:00
parent 87a02ffe72
commit cab10edd1d
3 changed files with 13 additions and 2 deletions

View File

@@ -61,6 +61,8 @@ return function (name , G, loader)
setmetatable(G, { __index = env , __newindex = init_system })
local pattern
do
local path = skynet.getenv "snax"
@@ -70,6 +72,7 @@ return function (name , G, loader)
local filename = string.gsub(pat, "?", name)
local f , err = loader(filename, "bt", G)
if f then
pattern = pat
mainfunc = f
break
else
@@ -90,5 +93,5 @@ return function (name , G, loader)
G[k] = v
end
return func
return func, pattern
end