mirror of
https://github.com/kvz/bash3boilerplate.git
synced 2024-12-18 22:27:51 +00:00
Introduce errtrace
, which is on by default (BREAKING)
This commit is contained in:
parent
f7fc992b2d
commit
649b5a0f44
@ -4,6 +4,7 @@
|
||||
|
||||
Released: Unreleased. [Commit log](https://github.com/kvz/bash3boilerplate/compare/v2.0.0...master)
|
||||
|
||||
- Introduce `errtrace`, which is on by default (BREAKING)
|
||||
- Add a configurable `helptext` that is left alone by the parses and allows you to have a richer help
|
||||
- Add a simple documentation website
|
||||
- Add best practice of using `__double_underscore_prefixed_vars` to indicate global variables that are solely controlled inside your script
|
||||
|
2
main.sh
2
main.sh
@ -37,6 +37,8 @@
|
||||
# `set` is safer than relying on a shebang like `#!/bin/bash -e` because that is neutralized
|
||||
# when someone runs your script as `bash yourscript.sh`
|
||||
set -o errexit
|
||||
# Exit on error inside any functions or subshells.
|
||||
set -o errtrace
|
||||
set -o nounset
|
||||
|
||||
# Bash will remember & return the highest exitcode in a chain of pipes.
|
||||
|
Loading…
Reference in New Issue
Block a user