forked from UtrechtUniversity/KI1V13001-Inleiding-Logica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·107 lines (100 loc) · 2.24 KB
/
configure
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/zsh
# TODO URGENT: make this run on bash! It doesn't because of the array stuff..
# Read relevant input from `info.conf ` and make it available for the build.
# Check that our dependencies are there...
if ! command -v pandoc &> /dev/null
then
>&2 echo "Couldn't find pandoc. Make sure it's installed and in your PATH."
exit 1
fi
# # TODO I think fd is no longer used anywhere. Check...
# if ! command -v fd &> /dev/null
# then
# >&2 echo "Couldn't find fd. Make sure it's installed and in your PATH."
# exit 1
# fi
# Base directories...
TMP_DIR=tmp
# Clear temp directory if it exists already
[ -d $TMP_DIR ] & rm -rf $TMP_DIR
mkdir $TMP_DIR
# Payloads...
INFO_FILE=$TMP_DIR/info.md
SYL_FILE=${TMP_DIR}/08_tas.md
# The goods...
source ./info.conf
# Process info
# General
cat <<EOF >> $INFO_FILE
---
academic-year: $ACADEMIC_YEAR
teamscode: $TEAMS_CODE
EOF
# Add lecturers...
cat <<EOF >> $INFO_FILE
lecturer:
EOF
for i in $(seq 1 ${#LECTURER_NAME[@]})
do
cat <<EOF
- name: $LECTURER_NAME[$i]
email: $LECTURER_EMAIL[$i]
office: $LECTURER_OFFICE[$i]
role: $LECTURER_ROLE[$i]
EOF
done >> $INFO_FILE
# Schedule
cat <<EOF >> $INFO_FILE
date:
EOF
# Add lecture dates
for i in $(seq 1 ${#LECTURE_DATE[@]})
do
cat <<EOF
- week: $i
date: $LECTURE_DATE[$i]
EOF
done >> $INFO_FILE
# Add exam dates
cat <<EOF >> $INFO_FILE
exam:
- name: Tussentoets
date: $MIDTERM_DATE
time: $MIDTERM_TIME
location: $MIDTERM_LOCATION
- name: Eindtoets
date: $ENDTERM_DATE
time: $ENDTERM_TIME
location: $ENDTERM_LOCATION
- name: Herkansing
date: $RESIT_DATE
time: $RESIT_TIME
location: $RESIT_LOCATION
EOF
# Add TAs
cat <<EOF >> $INFO_FILE
ta:
EOF
for i in $(seq 1 ${#TA_NAME[@]})
do
cat <<EOF
- name: $TA_NAME[$i]
workgroup: $i
EOF
done >> $INFO_FILE
# End of creation of info.md
echo "..." >> $INFO_FILE
# Syllabus helper...
# > Clear syllabus helper if it already exists
[ -f $SYL_FILE ] && rm $SYL_FILE
# > GIMME TAs
cat <<EOF >> ${SYL_FILE}
**WG** **TA**
-------- ------------
EOF
for i in $(seq 1 ${#TA_NAME[@]})
do
cat <<EOF
$i $TA_NAME[$i]
EOF
done >> $SYL_FILE