Lets say I have the file main.lua, and in a sub-directory I have a series of Lua scripts which I would like to run. Is there a way to run all the scripts in the subdirectory in plain vanilla Lua – that is, without needing to load any external modules or packages? The require and dofile work on only single files as far as I can tell, I would like to be able to do something like require "subdir/*".
Lets say I have the file main.lua , and in a sub-directory I have
Share
Do you have access to os.execute? Can you maintain a list of the modules you want to load?
If you have a full Lua interpreter it is pretty easy to do what you want. (Here’s an example for Windows)