-
Notifications
You must be signed in to change notification settings - Fork 0
/
move_material.sh
46 lines (37 loc) · 1.08 KB
/
move_material.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
#!/bin/bash
PDF=$1 # the slides
README=$2
ZIPDIR=$3
TEACH_PATH=$4 # where do you store your teaching material
COURSE_PATH=$5
SUBDIR_PATH=$6 # where this material will go
GIT_PUSH=$7
# get path to course material
COURSE_MATERIAL=$(find $TEACH_PATH -name $COURSE_PATH)
echo "Course Materials are located in:"
echo "$COURSE_MATERIAL"
# create material folder
MATERIAL_FOLDER=$COURSE_MATERIAL/$SUBDIR_PATH
echo "Intro slides will go to:"
echo "$MATERIAL_FOLDER"
mkdir $MATERIAL_FOLDER
# # send slides to material folder
echo "copying files to material folder"
# echo "cp $1 $MATERIAL_FOLDER"
cp $PDF $MATERIAL_FOLDER
# echo "cp $1 $MATERIAL_FOLDER"
cp $README $MATERIAL_FOLDER
cp $ZIPDIR $MATERIAL_FOLDER
if [ "$GIT_PUSH" = "true" ]; then
echo "pushing material online"
# push material online
cd $COURSE_MATERIAL && \
echo "switching to $COURSE_MATERIAL" && \
echo "updating local repo" && \
git pull && \
echo "adding new files" && \
git add . && \
git commit -am "update terminal material" && \
echo "pushing new material online" && \
git push
fi