lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello Rena!

This is exactly what I want to solve with my current project. A way of installing and setting up software that actually WORKS. It's not complicated. We use clever Lua glue code, that's all.

getlua.sh is step 1. Now comes smart Lua glue code.

Let's work together on this.

Stefan

---

Haha, new card :D

| Stefan Reich       |
| Leading Messiah    |
| The Lua OS Project |

On 2013-03-03 23:36, Rena wrote:
So, I've been developing some small applications in Lua, and one issue
that's come to light is once my app is installed, if it's made up of
more than one script, the main 'executable' script needs to know where
to find the other scripts.
It's enough to use os.getenv('PWD') .. arg[0] during testing, but that
won't work if the script is in the $PATH. Unfortunately my
understanding is there's no standard way to determine the current path
of the executable.

I'm also not sure what is the best practice when it comes to
installing a program that consists of several files (the main
executable and several sub-scripts it includes) on a Linux system.
With a compiled language you can split your source code into as many
files as you like and still produce a single compiled binary, but with
Lua all those individual files *are* your "binary".

Should I just install the main script in the usual place
(/usr/local/bin or /usr/bin), the additional scripts in some other
standard place (/usr[/local]/share/appname/?), and have it try to find
them in those standard places? Or is there a better way to handle
this?