Template
main.sh engine + example.sh demo + adoption policy (new scripts start from b3bp; existing retrofit opportunistically on touch; vendored copy pruned from shellcheck scan — upstream code, not house-audited). Founder directive 2026-09-05. https://projects.knownelement.com/issues/797
22 lines
933 B
Markdown
22 lines
933 B
Markdown
# bash3boilerplate (b3bp) — house standard for new operational shell scripts
|
|
|
|
Vendored 2026-09-05 from https://github.com/kvz/bash3boilerplate (MIT,
|
|
attribution headers retained in main.sh/example.sh) per founder directive.
|
|
|
|
## Adoption policy
|
|
|
|
- **New operational scripts** in fleet repos should start from
|
|
`example.sh` (copy, rename, prune) — it gives: strict mode
|
|
(errexit/errtrace/nounset/pipefail), usage-heredoc-driven CLI parsing,
|
|
severity-leveled STDERR logging (LOG_LEVEL + NO_COLOR), safe magic
|
|
variables (`__dir`, `__file`).
|
|
- **Existing scripts**: retrofit opportunistically when touched; do not
|
|
churn working scripts solely to adopt b3bp.
|
|
- House enforcement (check-rules.sh: shellcheck, secret scan, ticket gate)
|
|
continues to apply on top — b3bp does not replace it.
|
|
|
|
## Files
|
|
|
|
- `main.sh` — the b3bp engine; source it from your script (see example.sh)
|
|
- `example.sh` — full-pattern demonstration
|