Fix for when running in strict mode

This commit is contained in:
Tyler Akins 2017-11-13 10:31:51 -06:00
parent ad98577c42
commit 1e91e414cc
No known key found for this signature in database
GPG Key ID: 8F3B8C432F4393BD

4
mo
View File

@ -835,13 +835,13 @@ moShow() {
moSplit moNameParts "$1" "." moSplit moNameParts "$1" "."
if [[ -z "${moNameParts[1]}" ]]; then if [[ -z "${moNameParts[1]-}" ]]; then
if moIsArray "$1"; then if moIsArray "$1"; then
eval moJoin moJoined "," "\${$1[@]}" eval moJoin moJoined "," "\${$1[@]}"
echo -n "$moJoined" echo -n "$moJoined"
else else
# shellcheck disable=SC2031 # shellcheck disable=SC2031
if [[ -z "$MO_FAIL_ON_UNSET" ]] || moTestVarSet "$1"; then if [[ -z "${MO_FAIL_ON_UNSET-}" ]] || moTestVarSet "$1"; then
echo -n "${!1}" echo -n "${!1}"
else else
echo "Env variable not set: $1" >&2 echo "Env variable not set: $1" >&2