On This Page
Many2One is a utility to combine multiple lua source files into 1 file for easy usage and distribution. It consists of a lua file (many2one.lua) and an associated configuration file containing all the run information.
After running many2one with the config.lua of:
The MainApp.lua file is something like:
This command opens up config.lua and combines all the source files listed into the indicated output file
This command uses the configuration file myconfig.lua and combines all the source files listed in the indicated output file
It's simple to understand. The main program file is added in the variable
mainFile. The output file name is added in the variable
outputFile. All the other files required by the
mainFileor other files during run time are added as a list in the table fileList. If the list element is a table then the 1st item of the table is the path where to find that file and the 2nd item is the string which when required points to that file. So in the above case a
require "ssl.https"would return the module that was loaded from ssl/https.lua file.
And that is it.
It includes all the Lua files listed in the fileList of the config file as a string in the table
github repository. It is just a single script file called many2one.lua
You can also install using LuaRocks:
Once installed through LuaRocks you can directly run the script from the command line as: