aboutsummaryrefslogtreecommitdiff
path: root/src/hooks.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hooks.c')
-rw-r--r--src/hooks.c11
1 files changed, 11 insertions, 0 deletions
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;
+}