|
|
@ -5,12 +5,20 @@ set -euo pipefail |
|
|
|
IFS=' |
|
|
|
IFS=' |
|
|
|
' |
|
|
|
' |
|
|
|
|
|
|
|
|
|
|
|
echo insecure >> ~/.curlrc |
|
|
|
FILENAME="student/json-researcher.sh" |
|
|
|
caddy start &>/dev/null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submitted=$(bash student/json-researcher.sh) |
|
|
|
# True if FILE exists and is a regular file |
|
|
|
expected=$(bash solutions/json-researcher.sh) |
|
|
|
if [ -f ${FILENAME} ]; then |
|
|
|
|
|
|
|
# FILE exists and it's not empty |
|
|
|
caddy stop &>/dev/null |
|
|
|
if [ -s ${FILENAME} ]; then |
|
|
|
|
|
|
|
submitted=$(bash $FILENAME) |
|
|
|
diff <(echo "$submitted") <(echo "$expected") |
|
|
|
expected=$(bash solutions/json-researcher.sh) |
|
|
|
|
|
|
|
diff <(echo "$submitted") <(echo "$expected") |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
echo "The file exist but is empty" |
|
|
|
|
|
|
|
exit 1 |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
echo "File does not exist" |
|
|
|
|
|
|
|
exit 1 |
|
|
|
|
|
|
|
fi |