File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,18 @@ if "@LUA_PATH@" ~= "" then
44 package.cpath = "@LUA_CPATH@"
55end
66
7+ -- In the event the user has exported Lua environment variables, use them like a system Lua VM would. This essentially
8+ -- nukes the existing runtime path and uses only the new value. This is useful for using `eval $(luarocks --local path)`
9+ -- or similar incantations that setup a path that will reach 3rd party modules.
10+ local env_lua_path = os.getenv("LUA_PATH")
11+ if env_lua_path then
12+ package.path = env_lua_path
13+ end
14+ local env_lua_cpath = os.getenv("LUA_CPATH")
15+ if env_lua_cpath then
16+ package.cpath = env_lua_cpath
17+ end
18+
719local executable = debug.getinfo(3, "S").source
820local luaversion = _VERSION:match("%d+%.%d+")
921
You can’t perform that action at this time.
0 commit comments