shlib.sh: provide overrideable bang_exit function
commit2433700a31b293e22059e65d7526698591615543
authorKyle J. McKay <mackyle@gmail.com>
Fri, 2 Oct 2020 02:23:47 +0000 (1 19:23 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Fri, 2 Oct 2020 02:23:47 +0000 (1 19:23 -0700)
treea3e04db70316d400061d91f89c87c772aabcf0df
parent6dee39aa66dc6dbed901009c954708a89dc8da5b
shlib.sh: provide overrideable bang_exit function

When `bang_setup` is called, it sets a trap on EXIT.
This will step on any previously set trap on EXIT.

Make the EXIT trap set by `bang_setup` call a new
`bang_exit` function as its last action.

Provide a placeholder `bang_exit` function that
does nothing.

This way the `bang_exit` function can be replaced
before calling `bang_setup` thereby avoiding loss
of any needed EXIT trap activity as a result of
the EXIT trap set by `bang_setup`.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
shlib.sh