From 7ebe63e6d30a9b6cd3c717fea44d85e963eb455f Mon Sep 17 00:00:00 2001 From: Vasiliy Stelmachenok Date: Wed, 13 Nov 2024 21:59:02 +0300 Subject: [PATCH] scripts/chwd: Use dot notation for hook names Signed-off-by: Vasiliy Stelmachenok --- scripts/chwd | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/chwd b/scripts/chwd index 5a575b4..1e8f04c 100755 --- a/scripts/chwd +++ b/scripts/chwd @@ -263,9 +263,9 @@ local function main() end if options.install then - exec_hook(hooks["pre_install"]) + exec_hook(hooks.pre_install) - local conditional_packages = exec_hook(hooks["conditional_packages"]) + local conditional_packages = exec_hook(hooks.conditional_packages) if conditional_packages then packages = packages .. " " .. conditional_packages @@ -273,16 +273,16 @@ local function main() local code = install(packages) if code ~= 0 then - exec_hook(hooks["pre_remove"]) + exec_hook(hooks.pre_remove) die("ERROR: Pacman command was failed! Exit code: %s", code) else - exec_hook(hooks["post_install"]) + exec_hook(hooks.post_install) end elseif options.remove then - exec_hook(hooks["pre_remove"]) + exec_hook(hooks.pre_remove) - local conditional_packages = exec_hook(hooks["conditional_packages"]) + local conditional_packages = exec_hook(hooks.conditional_packages) if conditional_packages then packages = packages .. " " .. conditional_packages @@ -292,7 +292,7 @@ local function main() if code ~= 0 then die("ERROR: Pacman command was failed! Exit code: %s", code) else - exec_hook(hooks["post_remove"]) + exec_hook(hooks.post_remove) end else die("Action is missing, exit...")