Merge remote-tracking branch 'tai/master'

This commit is contained in:
Alexandre-Silva 2016-07-21 14:38:51 +01:00
commit 4f7fd392b0
3 changed files with 22 additions and 3 deletions

View File

@ -10,9 +10,16 @@ for TEST in tests/*.expected; do
BASE="${TEST%.expected}" BASE="${TEST%.expected}"
echo -n "$BASE ... " echo -n "$BASE ... "
echo "Do not read this input" | (
. "${BASE}.env" (
mo "${BASE}.template" if [[ -f "${BASE}.sh" ]]; then
# Run a shell script if one exists
"${BASE}.sh"
else
# Fall back to using .env and .template
. "${BASE}.env"
echo "Do not read this input" | mo "${BASE}.template"
fi
) | diff -wU5 - "${TEST}" > "${BASE}.diff" ) | diff -wU5 - "${TEST}" > "${BASE}.diff"
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then

8
tests/help.expected Normal file
View File

@ -0,0 +1,8 @@
Mo is a mustache template rendering software written in bash. It inserts
environment variables into templates.
Simply put, mo will change {{VARIABLE}} into the value of that
environment variable. You can use {{#VARIABLE}}content{{/VARIABLE}} to
conditionally display content or iterate over the values of an array.
Learn more about mustache templates at https://mustache.github.io/

4
tests/help.sh Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
cd "${0%/*}"
../mo --help