mirror of
https://github.com/tests-always-included/mo.git
synced 2025-11-19 23:34:32 +01:00
More bugfixes and shellcheck tweaks
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
cd "$(dirname "$0")" # Go to the script's directory
|
||||
|
||||
declare -A DATA
|
||||
DATA=([one]=111 [two]=222)
|
||||
export DATA=([one]=111 [two]=222)
|
||||
. ../mo
|
||||
|
||||
cat <<EOF | mo
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# This embeds a template in the script without using strange `cat` syntax.
|
||||
# shellcheck disable=SC1083 disable=SC1010 disable=SC1054 disable=SC1073 disable=SC1072 disable=SC1056 disable=SC1009
|
||||
|
||||
cd "$(dirname "$0")" # Go to the script's directory
|
||||
|
||||
|
||||
@@ -10,20 +10,22 @@ export ARRAY=( AAA BBB CCC )
|
||||
|
||||
# Include an external template
|
||||
INCLUDE() {
|
||||
cat "$MO_FUNCTION_ARGS"
|
||||
# shellcheck disable=SC2031
|
||||
cat "${MO_FUNCTION_ARGS[0]}"
|
||||
}
|
||||
|
||||
# Print section title
|
||||
TITLE() {
|
||||
echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"
|
||||
echo "$MO_FUNCTION_ARGS"
|
||||
# shellcheck disable=SC2031
|
||||
echo "${MO_FUNCTION_ARGS[0]}"
|
||||
echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"
|
||||
}
|
||||
|
||||
cat <<EOF | mo -u
|
||||
{{TITLE Part 1}}
|
||||
{{TITLE 'Part 1'}}
|
||||
{{INCLUDE function-args-part1}}
|
||||
|
||||
{{TITLE Part 2}}
|
||||
{{TITLE 'Part 2'}}
|
||||
{{INCLUDE function-args-part2}}
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user