mirror of
https://github.com/tests-always-included/mo.git
synced 2026-04-08 08:50:38 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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.
|
# Returns true (0) if the variable is set, 1 if the variable is unset.
|
||||||
MO_VAR_TEST="ok"
|
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
|
if test -v "MO_VAR_TEST" &> /dev/null; then
|
||||||
mo::debug "Using declare -p and [[ -v ]] for variable checks"
|
mo::debug "Using declare -p and [[ -v ]] for variable checks"
|
||||||
# More recent Bash
|
# More recent Bash
|
||||||
@@ -1048,6 +1051,7 @@ else
|
|||||||
mo::debug "Using declare -p for variable checks"
|
mo::debug "Using declare -p for variable checks"
|
||||||
# Bash 3.2
|
# Bash 3.2
|
||||||
mo::isVarSet() {
|
mo::isVarSet() {
|
||||||
|
# If the variable is exported and not assigned, declare -p will error.
|
||||||
if declare -p "$1" &> /dev/null; then
|
if declare -p "$1" &> /dev/null; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -2024,7 +2028,7 @@ mo::tokenizeTagContentsSingleQuote() {
|
|||||||
|
|
||||||
# Save the original command's path for usage later
|
# Save the original command's path for usage later
|
||||||
MO_ORIGINAL_COMMAND="$(cd "${BASH_SOURCE[0]%/*}" || exit 1; pwd)/${BASH_SOURCE[0]##*/}"
|
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 sourced, load all functions.
|
||||||
# If executed, perform the actions as expected.
|
# If executed, perform the actions as expected.
|
||||||
|
|||||||
Reference in New Issue
Block a user