Skip to content

Add error handling flags to shell scripts in package #1556

@coderabbitai

Description

@coderabbitai

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:

set -eu
set -o pipefail

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions