Skip to content

Commit

Permalink
scripts/chwd: Use dot notation for hook names
Browse files Browse the repository at this point in the history
Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
  • Loading branch information
ventureoo committed Nov 13, 2024
1 parent e8694fa commit 7ebe63e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/chwd
Original file line number Diff line number Diff line change
Expand Up @@ -263,26 +263,26 @@ 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
end

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
Expand All @@ -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...")
Expand Down

0 comments on commit 7ebe63e

Please sign in to comment.