From d62326ee93521de490e5bc8d37bf234111187e20 Mon Sep 17 00:00:00 2001 From: dacctal Date: Thu, 20 Aug 2026 10:51:26 +0000 Subject: barebones update functionality --- src/hooks.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/hooks.c') diff --git a/src/hooks.c b/src/hooks.c index 448c7a4..18ad31c 100644 --- a/src/hooks.c +++ b/src/hooks.c @@ -134,3 +134,14 @@ bool pkg_hook_on_update(package_t *pkg) { pkg_hook_recipe("on_update", pkg); return true; } + +bool config_hook_on_update(void) { + lua_get_field_type("on_update", function, &config.init_path, 1); + lua_run_function("on_update", &config.init_path, 0, 1, 1); + if (!lua_isnumber(L, -1) || lua_tonumber(L, -1) != 0) { + lua_pop(L, 1); + return false; + } + lua_pop(L, 1); + return true; +} -- cgit v1.2.3