neolithos / neolua

A Lua implementation for the Dynamic Language Runtime (DLR).
https://neolua.codeplex.com/
Apache License 2.0
466 stars 76 forks source link

Ensure lua can replace '?' in packa path with module name when requiring modules. #172

Closed powercode closed 1 year ago

powercode commented 1 year ago

From the lua manual

For instance, if the path is the string

"./?.lua;./?.lc;/usr/local/?/init.lua" the search for the name foo.a will try to open the files ./foo/a.lua, ./foo/a.lc, and /usr/local/foo/a/init.lua, in that order.

The package path is also initialized from the environment variable LUA_PATH,

package.path

The path used by require to search for a Lua loader. At start-up, Lua initializes this variable with the value of the environment variable LUA_PATH_5_3 or the environment variable LUA_PATH

neolithos commented 1 year ago

Thanks you!