-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·42 lines (33 loc) · 940 Bytes
/
setup.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
#! /bin/sh
echo 'setup'
lib='./lib'
ngVersion='1.3.10'
ngString="angular-$ngVersion"
ngZip=$ngString".zip"
if [ ! -d $lib ]; then
echo 'setup lib dir'
mkdir $lib
chmod go+rx $lib
fi
if [ ! -f $lib/d3.js ]; then
echo 'get d3'
curl https://raw.githubusercontent.com/mbostock/d3/master/d3.js -o $lib/d3.js
fi
if [ ! -f $lib/angular.zip ] && [ ! -f $lib/$ngString/angular.js ]; then
echo 'get angular zip'
curl -Lk https://code.angularjs.org/$ngVersion/$ngZip -o $lib/angular.zip
fi
if [ -f $lib/angular.zip ] && [ ! -f $lib/$ngString/angular.js ]; then
echo 'install angular and cleanup'
#unzip angular.zip js/lib/$ngString/*.* -x * -d ./ -u -o
unzip $lib/angular.zip -d $lib/
cd $lib/
ln -s ./$ngString ./ng
cd ..
rm -f $lib/angular.zip
fi
echo 'update har loader'
curl https://raw.githubusercontent.com/thtr/harharhar/master/harharhar.js -o $lib/harharhar.js
echo 'fix permissions'
chmod -R go+r $lib
echo 'all done'