Context
User @junhaoliao requested tracking an improvement to add error handling flags to shell scripts in the package template.
Description
Shell scripts in components/package-template/src/sbin/ should include error handling flags at the beginning to make them more robust:
These flags will:
- Exit early on any error (
-e / errexit)
- Exit on unset variables (
-u / nounset)
- Make pipelines fail if any command in them fails (
pipefail)
Note: Use separate set -eu and set -o pipefail commands for consistency with the established pattern in CLP project build scripts.
Affected Scripts
Scripts in components/package-template/src/sbin/ directory, including:
- admin-tools/archive-manager.sh
- admin-tools/dataset-manager.sh
- compress-from-s3.sh
- compress.sh
- decompress.sh
- search.sh
- start-clp.sh
- stop-clp.sh
- .common-env.sh
References
Context
User @junhaoliao requested tracking an improvement to add error handling flags to shell scripts in the package template.
Description
Shell scripts in
components/package-template/src/sbin/should include error handling flags at the beginning to make them more robust:These flags will:
-e/errexit)-u/nounset)pipefail)Note: Use separate
set -euandset -o pipefailcommands for consistency with the established pattern in CLP project build scripts.Affected Scripts
Scripts in
components/package-template/src/sbin/directory, including:References
sbinvia Docker Compose; Remove redundant assets from the package (resolves #1358). #1512sbinvia Docker Compose; Remove redundant assets from the package (resolves #1358). #1512 (comment)