Skip to content

Commit

Permalink
scripts/chwd: Print warning about unknown hook only if it is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
ventureoo committed Nov 17, 2023
1 parent 138bcc3 commit 298a32f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/chwd
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ local function remove(packages)
end

local function exec_hook(hook)
if not hook then
print("WARNING: An unknown hook is being called")
return
end

if hook ~= "" then
local file = io.popen(("/bin/bash -c '%s'"):format(hook), "r")

Expand All @@ -116,8 +121,6 @@ local function exec_hook(hook)
else
print("ERROR: Unkown shell invocation error", hook)
end
else
print("WARNING: An unknown hook is being called")
end
end

Expand Down

0 comments on commit 298a32f

Please sign in to comment.