mirror of
https://github.com/tests-always-included/mo.git
synced 2026-04-08 08:50:38 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbefade193 | ||
|
|
57a8d41394 | ||
|
|
5739ccd705 | ||
|
|
f889c37316 | ||
|
|
4f615a0faf | ||
|
|
1e91e414cc |
@@ -41,7 +41,7 @@ There are a few ways you can install this tool. How you install it depends on h
|
|||||||
You can install this file in `/usr/local/bin/` or `/usr/bin/` by simply downloading it, changing the permissions, then moving it to the right location. Double check that your system's PATH includes the destination folder, otherwise users may have a hard time starting the command.
|
You can install this file in `/usr/local/bin/` or `/usr/bin/` by simply downloading it, changing the permissions, then moving it to the right location. Double check that your system's PATH includes the destination folder, otherwise users may have a hard time starting the command.
|
||||||
|
|
||||||
# Download
|
# Download
|
||||||
curl -sS https://git.io/get-mo -o mo
|
curl -sSL https://git.io/get-mo -o mo
|
||||||
|
|
||||||
# Make executable
|
# Make executable
|
||||||
chmod +x mo
|
chmod +x mo
|
||||||
|
|||||||
11
mo
11
mo
@@ -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
|
||||||
@@ -1030,11 +1030,14 @@ moTrimWhitespace() {
|
|||||||
# Returns nothing.
|
# Returns nothing.
|
||||||
moUsage() {
|
moUsage() {
|
||||||
grep '^#/' "${MO_ORIGINAL_COMMAND}" | cut -c 4-
|
grep '^#/' "${MO_ORIGINAL_COMMAND}" | cut -c 4-
|
||||||
|
echo ""
|
||||||
|
set | grep ^MO_VERSION=
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# 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="2.0.4"
|
||||||
|
|
||||||
# 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