shelllings |
git clone https://git.davidvoz.net/shelllings.git
|
| 1 | #!/bin/sh |
| 2 | |
| 3 | set -eu |
| 4 | RED="\033[31m" |
| 5 | GREEN="\033[32m" |
| 6 | RESET="\033[0m" |
| 7 | |
| 8 | [ -f ".youfoundme" ] || touch .youfoundme |
| 9 | |
| 10 | cleanup() { |
| 11 | [ -e .youfoundme ] && rm -f .youfoundme |
| 12 | } |
| 13 | trap cleanup EXIT |
| 14 | |
| 15 | failed() { |
| 16 | printf "${RED}Failed${RESET}\n" |
| 17 | exit 1 |
| 18 | } |
| 19 | |
| 20 | sh exercises/03_listing.sh || failed |
| 21 | |
| 22 | [ -f ".youfoundme" ] && failed |
| 23 | |
| 24 | printf "${GREEN}Passed${RESET}\n" |