-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpcago_starter_linux.sh
executable file
·64 lines (45 loc) · 1.04 KB
/
pcago_starter_linux.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
app_dir=$(pwd)
pcago_dir=$1
# Initialize packrat (Will install everything)
echo "[1/3] Bootstrapping packrat package management system ..."
cd $pcago_dir
R --vanilla -f packrat/init.R --args --bootstrap-packrat &
pid=$!
trap "kill $pid" TERM
wait
cd $app_dir
# Force packrat to REALLY restore all libraries (because sometimes it does NOT)
echo "[2/3] Forcing packrat to restore all libraries ..."
cd $pcago_dir
echo "
source('packrat/init.R')
packrat::restore()
" | R --vanilla &
pid=$!
trap "kill $pid" TERM
wait
cd $app_dir
# Start PCAGO
echo "[3/3] Starting PCAGO ..."
cd $pcago_dir
echo "
# Starter script for PCAGO
source('packrat/init.R')
# Set the path of ffmpeg
ffmpeg.path <- '/usr/bin/ffmpeg'
if(!file.exists(ffmpeg.path)) {
print('Using static build of ffmpeg.')
ffmpeg.path <- '../ffmpeg-linux-x64/ffmpeg'
}
if(!file.exists(ffmpeg.path)) {
print('ffmpeg does not exist!')
q()
}
print(paste('Path of ffmpeg is', ffmpeg.path))
shiny::runApp()
" | R --vanilla &
pid=$!
trap "kill $pid" TERM
wait
cd $app_dir