-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathinstall
executable file
·51 lines (39 loc) · 1.05 KB
/
install
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
#!/bin/bash
black () { color_text 30; }
blue () { color_text 34; }
green () { color_text 32; }
cyan () { color_text 36; }
red () { color_text 31; }
purple () { color_text 35; }
brown () { color_text 33; }
light_gray () { color_text 37; }
color_text () {
while read data; do echo -e "\033[$1m$data"; done
echo -e -n "\033[0m" # clear the color
}
DIR=`dirname $0`
PACKAGES=$@
echo " ***** SETUP..." | purple
# make sure apt-get is up to date
apt-get update -qq
# install pak if it doesn't already exist
echo " ***** INSTALL PAK..." | purple
Rscript "$DIR/pak/setup.R"
for PACKAGE in $PACKAGES; do
PACKAGE_DIR=$DIR/packages/$PACKAGE
echo " ***** PACKAGE $PACKAGE" | purple
echo " ***** INSTALLING..." | purple
if [ -f $PACKAGE_DIR/install ]; then
bash $PACKAGE_DIR/install
else
Rscript "$DIR/pak/install_sys_reqs.R" $PACKAGE
fi
return_code=$?
if [[ $return_code != 0 ]] ; then
echo "$PACKAGE... FAILED" | red
exit $return_code
else
echo "$PACKAGE... SUCCESS" | green
fi
done
exit 0