Commit 895c9f7f authored by Baptiste Daroussin's avatar Baptiste Daroussin
Browse files

lua: hook the new lua_exec and load all functions in triggers

parent 76bb3c5f
......@@ -90,6 +90,7 @@ pkg_lua_script_run(struct pkg * const pkg, pkg_lua_script type, bool upgrade)
{ "filecmp", lua_pkg_filecmp },
{ "copy", lua_pkg_copy },
{ "stat", lua_stat },
{ "exec", lua_exec },
{ NULL, NULL },
};
close(cur_pipe[0]);
......
......@@ -381,6 +381,17 @@ trigger_execute_lua(const char *script, kh_strings_t *args)
L = luaL_newstate();
luaL_openlibs(L);
lua_override_ios(L, false);
static const luaL_Reg pkg_lib[] = {
{ "print_msg", lua_print_msg },
{ "prefixed_path", lua_prefix_path },
{ "filecmp", lua_pkg_filecmp },
{ "copy", lua_pkg_copy },
{ "stat", lua_stat },
{ "exec", lua_exec },
{ NULL, NULL },
};
luaL_newlib(L, pkg_lib);
lua_setglobal(L, "pkg");
char *dir;
char **arguments = NULL;
int i = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment