@@ -37,21 +37,25 @@ rm -f "${BASEPATH}/provided_code/submission.concatenated"
37
37
rm -f " ${BASEPATH} /provided_code/tokens.json"
38
38
rm -f " ${BASEPATH} /provided_code/hashes.txt"
39
39
40
- # create these directories if they don't already exist
40
+ # Make a logs directory so we can start logging any errors
41
41
mkdir -p " ${BASEPATH} /logs"
42
- mkdir -p " ${BASEPATH} /provided_code"
43
- mkdir -p " ${BASEPATH} /provided_code/files"
44
- mkdir -p " ${BASEPATH} /other_gradeables"
45
- mkdir -p " ${BASEPATH} /users"
46
42
47
43
# Run Lichen and exit if an error occurs
48
44
{
45
+ # Create these directories if they don't already exist
46
+ mkdir -p " ${BASEPATH} /provided_code"
47
+ [ -d " ${BASEPATH} /provided_code/files" ] || {
48
+ # If PHP hasn't created a files directory already, create one and set the permissions
49
+ # to allow PHP to edit files here in the future
50
+ mkdir " ${BASEPATH} /provided_code/files"
51
+ chmod g+wx " ${BASEPATH} /provided_code/files" || exit 1
52
+ }
53
+ mkdir -p " ${BASEPATH} /other_gradeables"
54
+ mkdir -p " ${BASEPATH} /users"
55
+
49
56
# ###########################################################################
50
57
# Finish setting up Lichen run
51
58
52
- # The default is r-x and we need PHP to be able to write if edits are made to the provided code
53
- chmod g=rwxs " ${BASEPATH} /provided_code/files" || exit 1
54
-
55
59
cd " $( dirname " ${0} " ) " || exit 1
56
60
57
61
# ###########################################################################
0 commit comments