diff options
| author | dacctal <donotcontactmevia@email.invalid> | 2026-08-20 10:51:26 +0000 |
|---|---|---|
| committer | dacctal <donotcontactmevia@email.invalid> | 2026-08-20 10:51:26 +0000 |
| commit | d62326ee93521de490e5bc8d37bf234111187e20 (patch) | |
| tree | 8d270aa3b737af47871bfb47937b17154e81f4f9 /src/hooks.c | |
| parent | 51983b47b22db7bf819e9880caa2b72bdb8c9942 (diff) | |
barebones update functionality
Diffstat (limited to 'src/hooks.c')
| -rw-r--r-- | src/hooks.c | 11 |
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; +} |
