forked from ambujtewari/stats306-fall2017
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy path.startup.sh
33 lines (29 loc) · 862 Bytes
/
.startup.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
#!/bin/bash -x
exec > .log.txt 2>&1
REPOSRC=https://github.com/terhorst/stats306
LOCALREPO=.stats306_fresh
# We do it this way so that we can abstract if from just git later on
LOCALREPO_VC_DIR=$LOCALREPO/.git
if [ ! -d $LOCALREPO_VC_DIR ]
then
git clone --depth 1 $REPOSRC $LOCALREPO
else
cd $LOCALREPO
chmod -R 777 .
rm -f .git/index.lock
git fetch
git reset --hard origin/master
cd ..
fi
(chmod -R 777 stats306 && rm -rf stats306) || true
find . -name 'core.ZMQ*' -delete
find . -name 'core.R*' -delete
chmod -R a=rX $LOCALREPO
rm -f README.txt .Rprofile
cp "$LOCALREPO/.README.txt" ./README.txt
cp "$LOCALREPO/.Rprofile" .Rprofile
chmod 444 .Rprofile README.txt
rsync --ignore-existing -ra "$LOCALREPO/lectures" .
rsync -av --ignore-existing "$LOCALREPO/problem sets" .
chmod -R a=rwX 'problem sets'
chmod -R a=rwX 'lectures'