Last active
December 25, 2015 05:59
-
-
Save kaka19ace/6928924 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
rootDir = "/opt/project" | |
this script is at /opt/project/sample.lua | |
if you want to lua sample.lua and require your custom lua module. | |
eg: | |
/opt/project/dep/lua/xxx.lua | |
/opt/project/dep/lib/lua/xxx.so # some lua module c lib | |
--]] | |
-- may be fix bug | |
local rootPath = string.gsub(debug.getinfo(1).source, "^@(.+/).*%.lua$", "%1") | |
-- rootPath is /opt/project/ | |
depLuaDir = rootPath.."dep/" | |
depLuaPath = depLuaDir .. "lua/?.lua;" | |
depLuaCPath = depLuaDir .. "lib/lua/?.so;" | |
package.path = table.concat({depLuaPath, package.path}) | |
package.cpath = table.concat({depLuaCPath..";", package.cpath}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment