3 Commits
2.0.0 ... 2.0.3

Author SHA1 Message Date
Tyler Akins
f889c37316 Found another issue with strict mode 2017-11-13 13:53:38 -06:00
Tyler Akins
4f615a0faf More fixes if variables are not set and strict mode is enabled 2017-11-13 10:43:32 -06:00
Tyler Akins
1e91e414cc Fix for when running in strict mode 2017-11-13 10:31:51 -06:00

8
mo
View File

@@ -146,7 +146,7 @@ moCallFunction() {
moArgs=() moArgs=()
# shellcheck disable=SC2031 # shellcheck disable=SC2031
if [[ -n "$MO_ALLOW_FUNCTION_ARGUMENTS" ]]; then if [[ -n "${MO_ALLOW_FUNCTION_ARGUMENTS-}" ]]; then
moArgs=$3 moArgs=$3
fi fi
@@ -835,15 +835,15 @@ 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 moTestVarSet "$1"; then
echo -n "${!1}" echo -n "${!1}"
else elif [[ -n "${MO_FAIL_ON_UNSET-}" ]]; then
echo "Env variable not set: $1" >&2 echo "Env variable not set: $1" >&2
exit 1 exit 1
fi fi