mlua-rs / rlua

High level Lua bindings to Rust
Other
1.73k stars 115 forks source link

custom runtime path #282

Closed paulfrische closed 1 year ago

paulfrische commented 1 year ago

Hello there, I think there is no way yet to change the path(s) require searches in when requiring other modules. Is the solution to just write your own require?

jugglerchris commented 1 year ago

The builtin Lua require is quite configurable: https://www.lua.org/manual/5.4/manual.html#pdf-require

For example you can adjust package.path as you like, either from Rust or executing some lua.

paulfrische commented 1 year ago

Thank you! Maybe an example in the repo wouldn't hurt, would it?

jugglerchris commented 1 year ago

Indeed not - and thanks for your contribution! (#283 )