-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkzip.sh
50 lines (45 loc) · 1.58 KB
/
checkzip.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# DO NOT EDIT THIS FILE
FILE=monopoly.zip
zip=good
if [ -e $FILE ]; then
echo "$FILE exists. Good."
if zipinfo -1 $FILE | grep -q "^main.ml$"; then
echo "main.ml is in the root folder of the zip. Good."
else
echo "main.ml is NOT in the root folder of the zip. This is bad."
echo "Did you create the zip by running \"make zip\"?"
zip=bad
fi
else
echo "$FILE does NOT exist. This is bad. Have you run \"make zip\"?"
zip=bad
fi
if [[ "$zip" == good ]]; then
cat <<EOF
===========================================================
Your zip file looks good to me. Congratulations!
===========================================================
I checked to make sure your zip contains at least one of
your source files, but I can't check to make sure it contains
all of them, because I can't know what modules or test files
you might have added. As long as you created the zip by running
"make zip", it will have them. But just in case you want to
double check, run this command:
$ zipinfo -1 $FILE
EOF
else
cat <<EOF
===========================================================
WARNING
Your zip file looks broken to me. The code that
you submit might not compile on the grader's machine,
leading to heavy penalties. Please fix your zip file.
Check the error messages above carefully to determine
what is wrong with your file. The most common mistake
is creating the zip using your OS's file browser, instead
of using "make zip". See a consultant for help if you
cannot determine what is wrong.
===========================================================
EOF
fi