]> git.koha-community.org Git - koha.git/commit
Bug 25634: Warn if koha-shell returns non-zero in koha-foreach
authorDavid Cook <dcook@prosentient.com.au>
Mon, 1 Jun 2020 23:53:06 +0000 (09:53 +1000)
committerLucas Gass <lucas@bywatersolutions.com>
Wed, 17 Jun 2020 20:32:29 +0000 (20:32 +0000)
commit79663817ec58b23525f08862210ad4c29fe89d33
treef95600b8565849d5e5f1ce481537585895a19c40
parentff26937f5035cc41d5b3b1b17cfc3336d73d1b5c
Bug 25634: Warn if koha-shell returns non-zero in koha-foreach

By putting koha-shell in an if statement, "set -e" will no longer
cause the entire koha-foreach program to exit, if koha-shell
returns a non-zero status.

If a non-zero status is returned, we warn on it, and the caller
of koha-foreach can interpret that command visually.

To Test:
1) Write a shell script that says "Hello" and then exits with a 1
status
2) Run koha-foreach against that shell script with multiple instances
available to koha-foreach
3) Before the patch, koha-foreach will die after the first "Hello"
4) After the patch, koha-foreach will continue, through all the
instances, and report which instances returned non-zero statuses
by which command.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4c548cb08f3f3013778da71d47745f48b6adffd8)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
debian/scripts/koha-foreach