Skip to content

Commit

Permalink
Handling empty env vars in strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
navaneeth-spotnana committed Feb 4, 2021
1 parent ec213c5 commit 0b4d391
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions use
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fi
TBLS_ARCHIVE="/tmp/tbls.${TBLS_EXT}"

TBLS_RELEASES_URL="https://github.com/k1LoW/tbls/releases"
test -z "$TBLS_TMPDIR" && TBLS_TMPDIR="$(mktemp -d)"
test -z "${TBLS_TMPDIR:-}" && TBLS_TMPDIR="$(mktemp -d)"

last_version() {
curl -sL -o /dev/null -w %{url_effective} "$TBLS_RELEASES_URL/latest" |
Expand All @@ -28,8 +28,8 @@ last_version() {
}

download() {
test -z "$TBLS_VERSION" && TBLS_VERSION="$(last_version)"
test -z "$TBLS_VERSION" && {
test -z "${TBLS_VERSION:-}" && TBLS_VERSION="$(last_version)"
test -z "${TBLS_VERSION:-}" && {
echo "Unable to get tbls version." >&2
exit 1
}
Expand Down

0 comments on commit 0b4d391

Please sign in to comment.