Hooks/extension for AconfSave #153
VorpalBlade
started this conversation in
Ideas
Replies: 1 comment 1 reply
|
I'm open to discussing a design for this. Ideally, such an extension mechanism could allow implementing plugins such as user management.
Unfortunately we can't use this exact mechanism, as there's no way to check the exit code of a function in bash without altogether disabling error handling for the duration of the function's execution. It would either have to be a subprocess (not a function or fork/subshell) or communicate the result in some other way, like a string on stdout or setting a global variable. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I would like some sort of hooking/extension system for
aconfmgr save:I use some helper functions (such as the passwd/group helpers from the wiki and my own systemd helpers that I also put there). I would like for
saveto use those instead of emittingCreateFile /etc/passwd,CreateLinketc (where appropriate).The best way seems to be if there was a hooking/extension system of some sort to do this. Perhaps an array of filter functions that could either return false (return code != 0) to process as normal/continue to next filter or return true (0) and some output to use instead.
My interest here is for handling config files. While there could also be hooks for handling installed packages I don't see any obvious use cases.
All reactions