mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-02-26 04:14:50 +01:00
new hooks break old installation #195
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ezbik on GitHub (Jan 30, 2017).
After upgrade to new release with new hooks, it is required to edit your
hook.shmanually and insert those new empty hook functions. Without this, everything is broken:@ezbik commented on GitHub (Jan 30, 2017):
Is it possible to modify behavior of hook handling, so that if a hook function is not defined then ignore it?
@lukas2511 commented on GitHub (Jan 30, 2017):
The problem is in the hook script, I'm planning on making the example hook better, ignoring unknown hooks instead of throwing errors, but for now the best fix is to just add the exit_hook from the example script to your own script.
@lukas2511 commented on GitHub (Jan 30, 2017):
This fix of course doesn't magically fix old modified example hook scripts, you'll have to add the change yourself, but it will ensure this problem doesn't occur again in the future.
@ezbik commented on GitHub (Jan 30, 2017):
Thanks for looking into this, but your commit
e545292complicates it even more -- to sync between old and newhook.sh, a pattern list must be inserted/updated too.Isn't it be better to let user only edit his scripts and not play with
hook.sh?E.g. by expecting user scripts in folders like
./hook/${hook_function_name}.d/, and running them viarun-partswith exporting required variables?@lukas2511 commented on GitHub (Jan 30, 2017):
Switching to a directory and run-parts would change everything completely, and this pattern list is just part of the example hook, other hook scripts probably never had any problems, and this way I can add new hooks without the example script failing again, I think this is a good and easy solution for this problem. If you ever want to make use of a new hook you just have to add it to the list and write a handler function, don't see any problem with that.