-
Notifications
You must be signed in to change notification settings - Fork 57
/
init_utilitr.sh
35 lines (35 loc) · 1.1 KB
/
init_utilitr.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
#!/bin/bash
echo "$PROTOCOL://$USERNAME:$TOKEN@$HOST" > /home/onyxia/git.store
chown onyxia /home/onyxia/git.store
chmod o-r,g-r /home/onyxia/git.store
runuser -l onyxia -c 'git config --global credential.helper "store --file ~/git.store"'
if [ -z "$FORK" ]
then
echo "Pas de clonage de dépôt"
elif [ "$FORK" = "TRUE" ]
then
runuser -l onyxia -c "cd $WORKSPACE_DIR && \
git clone https://github.com/$USERNAME/utilitr.git && \
cd utilitr && \
git remote add upstream https://github.com/inseefrlab/utilitr.git && \
git fetch upstream"
else
cd /home/onyxia/work
runuser -l onyxia -c "cd $WORKSPACE_DIR && \
git clone https://github.com/inseefrlab/utilitr.git && \
cd utilitr"
fi
if [ ! -z "$FORK" ]
then
# Open the project
echo \
"
setHook('rstudio.sessionInit', function(newSession) {
if (newSession && identical(getwd(), path.expand(\"$WORKSPACE_DIR\")))
{
message('Ouverture du tutoriel')
rstudioapi::openProject(\"$WORKSPACE_DIR/utilitr\")
}
}, action = 'append')
" >> /home/onyxia/.Rprofile
fi