mirror of
https://github.com/octoleo/lsyncd.git
synced 2025-01-22 14:48:29 +00:00
This commit is contained in:
parent
b41c2847ab
commit
0bf3e14cec
@ -9,8 +9,6 @@ settings = {
|
||||
loglevel = DEBUG,
|
||||
}
|
||||
|
||||
print(bla)
|
||||
|
||||
------
|
||||
-- for testing purposes
|
||||
--
|
||||
|
15
lsyncd.c
15
lsyncd.c
@ -1099,15 +1099,16 @@ main(int argc, char *argv[])
|
||||
/* initialize */
|
||||
/* lua code will set configuration and add watches */
|
||||
{
|
||||
ind idx = 0;
|
||||
int idx = 1;
|
||||
/* creates a table with all option arguments */
|
||||
lua_newtable(L);
|
||||
lua_pushnumber(L, idx++);
|
||||
lua_pushstring(L, argv[argp++]);
|
||||
lua_settable(L, -3);
|
||||
|
||||
lua_getglobal(L, "lsyncd_initialize");
|
||||
lua_call(L, 0, 0);
|
||||
lua_newtable(L);
|
||||
while(argp < argc) {
|
||||
lua_pushnumber(L, idx++);
|
||||
lua_pushstring(L, argv[argp++]);
|
||||
lua_settable(L, -3);
|
||||
}
|
||||
lua_call(L, 1, 0);
|
||||
}
|
||||
|
||||
masterloop(L);
|
||||
|
@ -426,10 +426,12 @@ end
|
||||
----
|
||||
-- Called from core on init or restart after user configuration.
|
||||
--
|
||||
function lsyncd_initialize()
|
||||
function lsyncd_initialize(args)
|
||||
-- From this point on, no globals may be created anymore
|
||||
GLOBAL_lock(_G)
|
||||
|
||||
print(table.concat(args))
|
||||
|
||||
-- makes sure the user gave lsyncd anything to do
|
||||
if #origins == 0 then
|
||||
log(ERROR, "nothing to watch. Use directory(SOURCEDIR, TARGET) in your config file.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user