mirror of
https://github.com/tests-always-included/mo.git
synced 2026-04-08 00:40:38 +02:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31ff19e954 | ||
|
|
40a715137c |
6
mo
6
mo
@@ -1032,6 +1032,9 @@ mo::isArrayIndexValid() {
|
||||
#
|
||||
# Returns true (0) if the variable is set, 1 if the variable is unset.
|
||||
MO_VAR_TEST="ok"
|
||||
|
||||
# This must not use `[[` because otherwise Bash 3.2 will stop execution and
|
||||
# always write to stderr without the ability to capture it.
|
||||
if test -v "MO_VAR_TEST" &> /dev/null; then
|
||||
mo::debug "Using declare -p and [[ -v ]] for variable checks"
|
||||
# More recent Bash
|
||||
@@ -1048,6 +1051,7 @@ else
|
||||
mo::debug "Using declare -p for variable checks"
|
||||
# Bash 3.2
|
||||
mo::isVarSet() {
|
||||
# If the variable is exported and not assigned, declare -p will error.
|
||||
if declare -p "$1" &> /dev/null; then
|
||||
return 0
|
||||
fi
|
||||
@@ -2024,7 +2028,7 @@ mo::tokenizeTagContentsSingleQuote() {
|
||||
|
||||
# Save the original command's path for usage later
|
||||
MO_ORIGINAL_COMMAND="$(cd "${BASH_SOURCE[0]%/*}" || exit 1; pwd)/${BASH_SOURCE[0]##*/}"
|
||||
MO_VERSION="3.0.7"
|
||||
MO_VERSION="3.1.0"
|
||||
|
||||
# If sourced, load all functions.
|
||||
# If executed, perform the actions as expected.
|
||||
|
||||
@@ -94,7 +94,7 @@ This is open source! Please feel free to contribute.
|
||||
|
||||
https://github.com/tests-always-included/mo
|
||||
|
||||
MO_VERSION=3.0.7
|
||||
MO_VERSION=3.1.0
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user