mirror of
https://github.com/tests-always-included/mo.git
synced 2025-11-19 23:34:32 +01:00
Adding an option to fail upon unset env variables
This commit is contained in:
1
tests/fail-not-set.expected
Normal file
1
tests/fail-not-set.expected
Normal file
@@ -0,0 +1 @@
|
||||
This will fail: Env variable not set: __NO_SUCH_VAR
|
||||
9
tests/fail-not-set.sh
Executable file
9
tests/fail-not-set.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "${0%/*}"
|
||||
unset __NO_SUCH_VAR
|
||||
echo "This will fail: {{__NO_SUCH_VAR}}" | ../mo --fail-not-set 2>&1
|
||||
|
||||
if [[ $? -ne 1 ]]; then
|
||||
echo "Did not return 1"
|
||||
fi
|
||||
@@ -11,6 +11,7 @@ Simple usage:
|
||||
|
||||
mo [--false] [--help] [--source=FILE] filenames...
|
||||
|
||||
--false - Treat the string "false" as empty for conditionals.
|
||||
--help - This message.
|
||||
--source=FILE - Load FILE into the environment before processing templates.
|
||||
--fail-not-set - Fail upon expansion of an unset variable.
|
||||
--false - Treat the string "false" as empty for conditionals.
|
||||
--help - This message.
|
||||
--source=FILE - Load FILE into the environment before processing templates.
|
||||
|
||||
Reference in New Issue
Block a user