-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup
executable file
·43 lines (42 loc) · 1.04 KB
/
setup
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
#!/bin/bash
function main {
which npm >/dev/null || (echo "Node.JS is not present" && exit 1)
which grunt >/dev/null || (echo "Grunt is not present : npm install -g grunt-cli" && exit 1)
if [ ! -d "reveal.js" ] || [ "$FORCE" == TRUE ]; then
echo "First setup might take a while ..."
rm -Rf reveal.js
git submodule init
git submodule update
if [ ! -d "reveal.js/node_modules" ] || [ "$FORCE" == TRUE ]; then
echo "Fetching and builing dependencies"
cd reveal.js
sudo npm install
cd -
fi
fi
if [ -e "reveal.js/index.html" ]; then
if [ ! -h "reveal.js/index.html" ]; then
rm -Rf reveal.js/index.html
ln -s ../index.html reveal.js/index.html
fi
else
ln -s ../index.html reveal.js/index.html
fi
if [ ! -d "reveal.js/images" ]; then
rm -Rf reveal.js/images
ln -s ../images reveal.js/images
else
ln -s ../images reveal.js/images
fi
}
while getopts ":f" opt; do
case $opt in
f)
FORCE=TRUE && echo "Will force setup"
;;
\?)
FORCE=FALSE
;;
esac
done
main