moth/pkg/transpile/testdata/static/3/mkpuzzle

39 lines
584 B
Plaintext
Raw Permalink Normal View History

2020-08-31 16:37:51 -06:00
#! /bin/sh
2020-09-14 18:23:56 -06:00
fail () {
echo "ERROR: $*" 1>&2
exit 1
}
case $1:$2 in
puzzle:)
2020-08-31 16:37:51 -06:00
cat <<'EOT'
{
"Answers": ["answer"],
"Pre": {
2020-09-01 20:12:57 -06:00
"Authors": ["neale"],
2020-08-31 16:37:51 -06:00
"Body": "I am a generated puzzle."
}
}
EOT
;;
2020-09-14 18:23:56 -06:00
file:moo.txt)
echo "Moo."
;;
file:*)
fail "no such file: $1"
;;
answer:moo)
2020-10-16 14:18:44 -06:00
echo '{"Correct":true}'
2020-09-14 18:23:56 -06:00
;;
answer:error)
fail "you requested an error"
2020-09-04 13:00:23 -06:00
;;
2020-09-14 18:23:56 -06:00
answer:*)
2020-10-16 14:18:44 -06:00
echo '{"Correct":false}'
2020-08-31 16:37:51 -06:00
;;
*)
2020-09-14 18:23:56 -06:00
fail "What is $1"
2020-08-31 16:37:51 -06:00
;;
esac