diff options
| author | Paul Buetow <paul@buetow.org> | 2023-03-15 19:09:52 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-03-15 19:09:52 +0200 |
| commit | d839e9159851934ed6cfb35f557c8313b88aa27c (patch) | |
| tree | a863be5fc962dcc8890e9930cf4f0a95e33864b0 | |
| parent | 4082179769e6ed50936db43ab674691dce4d9f7a (diff) | |
use safer bash options
| -rwxr-xr-x | gemtexter | 8 | ||||
| -rw-r--r-- | lib/generate.source.sh | 4 |
2 files changed, 9 insertions, 3 deletions
@@ -19,7 +19,13 @@ readonly DATE readonly SED readonly GREP -set -e +# Set unset variables to make 'set -u' work, they can optionally be passed as +# enviroments to Gemtexter +test -z "$CONFIG_FILE_PATH" && CONFIG_FILE_PATH='' +test -z "$GIT_COMMIT_MESSAGE" && GIT_COMMIT_MESSAGE='' +test -z "$LOG_VERBOSE" && LOG_VERBOSE='' + +set -euf -o pipefail if [[ -n "$CONFIG_FILE_PATH" ]]; then source "$CONFIG_FILE_PATH" diff --git a/lib/generate.source.sh b/lib/generate.source.sh index 848e7fd..1c0a823 100644 --- a/lib/generate.source.sh +++ b/lib/generate.source.sh @@ -2,8 +2,8 @@ generate::make_link () { local -r what="$1"; shift local -r line="${1/=> }"; shift - local link - local descr + local link='' + local descr='' while read -r token; do if [ -z "$link" ]; then |
