You have to do mgit clone https://github.com/luapower/luapower-repos too, that's where the platform.sh script is. I might embed that into bundle.sh in the future, though bundle itself is not very useful without the luapower repos (what would you bundle with it?)

You can't right now, but if you give me some details about your use case I could add an option for that.

mgit tries to behave like git, so it looks for a .mgit directory in the current directory or one of its parents, just like git looks for a .git directory. The mgit script itself you can put it in PATH by eg. symlinking it to /usr/bin.

As an example, I install the mgit, bundle and luapower-repos in /home/albert/luapower. Now my custom lua scripts is in /usr/local/programs. I would like to be able to issue the "mgit bundle -m --all -M main -o main.exe" from the /usr/local/programs directory. In essence, I want to keep my custom scripts directory separate from the luapower directory. Thanks.

I have done that but the issue is that I need to dump my source code in the /home/albert/luapower directory. The use case that I am look for is the ability to execute the bundle compiler on an directory of my choosing. Hope this clarify my use case scenario. Thanks.

I can see why you might feel uneasy adding your scripts to the flaming wok. You probably cloned all the modules and now you're looking at a directory with 450 files in it and say "what a mess, I don't want to mix my app with that". You want to use it all as an upstream library that you don't want to touch. I can understand that. But you'd be going against the grain if you do that. It would be much easier to use luapower as if it's you who's written it, as if it's yours and not something external to your project that you don't want to mess with. So make it yours, i.e.:

only clone the modules that you actually use -- seeing only relevant files will make it more approachable.

fork the modules that you think you might want to hack on and clone them from your own place -- hack them, remove stuff that you don't need from them and push the changes -- the modules are yours now.

embrace the directory conventions, they're just common sense after all, so put your binaries in bin/platform, put Lua files in root where the luajit launcher is, etc. All the tools will know where to find your files and you'll never have to specify paths on the command line.

your app will be mixed with other luapower modules on disk, yes, but it will still have its own completely separate git repository with its own history etc. (none of that git subtree merge crap either). As a bonus, anyone will be able to fork/clone your app directly into their own luapower tree in case you'll ever want to open its development to other luapower users.

I hope you'll to give it a shot, because adding command line options all the tools with all the search paths is a pain in the butt :)

Thanks for the clear explanation on your approach to luapower. FYI, I have only cloned the mgit, bundle and luapower-repos. Even that those three, I am bewildered with the sear amount of files and sub-directory.

Again my expectation was way off from your vision of luapower. I was thinking more along the line of mgit source compiled to an executable which in turn can be used for bundling/compiling of lua code into a standalone execute.

Anyway, I would like to express my sincere gratitude for all the work that you have done for the lua /luajit community. Thank you.

To make it less overwhelming you could type mgit ls-tracked to see which file was added in by which package. Or you could try cloning these again and look at how the directory evolves.

Let's summarize: cloning multigit adds in the mgit script, fair enough, then cloning luapower-repos adds in the .mgit directory which contains the origins of all known packages so you can do mgit clone bundle instead of mgit clone https://github.com/luapower/bundle. It also adds some scripts that are specific to luapower because multigit itself has nothing to do with luapower, it's just a way to clone multiple git repos overlapped. Finally, bundle adds in files all over the place. That's ok, all packages do that. This is why we have the luapower conventions, to allow packages to coexist peacefully in the same directory even when it's very crowded in there. This looks messy at first (just like a Linux system) but it's much more simple and scalable than putting each module in it's own directory and is in fact easier to use. It's just, well, not very mainstream, although it's weird to say that because that's how Linux works and Linux is very mainstream :)

The truth is that in order to make a good quality app you will have to know your full stack and be able to hack it at any level, no blackboxes. Luapower embraces that so it doesn't try to hide the guts, it just tries to organize them :)

Anyway I hope this helps. And thanks for the kind words. They're very much appreciated.

I have compiled a project of mine and the process when without any error. But I encounter this problem with luasql.mysql . How do I include it in the executable. Thanks.

./mainexe: ./main.lua:13: module 'luasql.mysql' not found:
no field package.preload['luasql.mysql']
no file './luasql/mysql.lua'
no file './luasql/mysql/init.lua'
no file './clib/luasql/mysql.dll'
no file './clib/luasql.dll'
no symbol 'Blua_luasql_mysql'
no symbol 'luaopen_luasql_mysql'

Bundle doesn't know how how to find libraries outside of the luapower tree. All dependencies must be included. In your case it looks like mysql.so is a Lua/C library and so you need to put it (or link it) in bin/linux64/clib/mysql.so

Btw, if that module was compiled against Lua 5.2 then it might not work with luajit (not sure)