Skip to content

Commit

Permalink
Merge pull request #59 from ventureoo/some-fixes
Browse files Browse the repository at this point in the history
scripts/chwd: Print warning about unknown hook only if it is nil
  • Loading branch information
ventureoo authored Nov 23, 2023
2 parents 138bcc3 + 298a32f commit e8b3e0f
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 e8b3e0f

Please sign in to comment.