set global SERVICE_PATH for compatibility

This commit is contained in:
Cloud Wu
2014-05-06 17:42:34 +08:00
parent 82c7cbc2f0
commit 18c8a9d20c

View File

@@ -27,8 +27,14 @@ package.path , LUA_PATH = LUA_PATH
package.cpath , LUA_CPATH = LUA_CPATH
local service_path = string.match(pattern, "(.*/)[^/?]+$")
if service_path then
package.path = service_path .. ";" .. package.path
service_path = string.gsub(service_path, "?", args[1])
package.path = service_path .. "?.lua;" .. package.path
SERVICE_PATH = service_path
else
local p = string.match(pattern, "(.*/).+$")
SERVICE_PATH = p
end
if LUA_PRELOAD then