Koha/debian/scripts
Evan Giles d9849aaa3a
Bug 34653: Make koha-foreach return the correct status code
I think the correct behavior for this script should be that koha-foreach
will return 0 (success) if all the commands it tried to run succeeded, but
1 (failure) if any of the commands failed.

To test:
1. $ koha-create --create-db test
2. $ vi test.sh
if [ $USER = 'kohadev-koha' ]; then
    echo "FAILED";
    exit 1;
else
    echo "SUCCESS";
    exit 0;
fi

3. $ debian/scripts/koha-foreach sh test.sh
FAILED
kohadev: 1 status returned by "sh test.sh"
SUCCESS
4. $ echo $?
5. Note that the exit status is 0 (success)

6. Apply patch

7. $ debian/scripts/koha-foreach sh test.sh
FAILED
kohadev: 1 status returned by "sh test.sh"
SUCCESS
8. $ echo $?
9. Note that the exit status is 1 (failure)

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-25 10:56:40 -03:00
..
koha-create
koha-create-dirs
koha-disable
koha-dump
koha-dump-defaults
koha-elasticsearch
koha-email-disable
koha-email-enable
koha-enable
koha-es-indexer
koha-foreach Bug 34653: Make koha-foreach return the correct status code 2023-09-25 10:56:40 -03:00
koha-functions.sh
koha-indexer
koha-list
koha-mysql
koha-mysqlcheck
koha-passwd Bug 28493: Make koha-passwd display the username 2023-07-19 13:00:41 -03:00
koha-plack
koha-rebuild-zebra
koha-remove
koha-reset-passwd
koha-restore
koha-run-backups
koha-shell
koha-sip
koha-sitemap
koha-translate
koha-upgrade-schema
koha-upgrade-to-3.4
koha-worker
koha-z3950-responder
koha-zebra