forked from forms-angular/forms-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframework.sh
More file actions
executable file
·76 lines (71 loc) · 2.21 KB
/
Copy pathframework.sh
File metadata and controls
executable file
·76 lines (71 loc) · 2.21 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
function Clear {
echo Clearing out bower component directories
rm -rf app/bower_components/bootstrap
mkdir app/bower_components/bootstrap
rm -rf app/bower_components/select2-bootstrap-css
mkdir app/bower_components/select2-bootstrap-css
rm -rf app/bower_components/angular-ui-bootstrap-bower
mkdir app/bower_components/angular-ui-bootstrap-bower
}
function InstallBootstrap {
if [ -d "app/bower_components/bootstrap-$1" ]; then
echo Using existing copy of Bootstrap $1
cp -r app/bower_components/bootstrap-$1/* app/bower_components/bootstrap
else
echo Downloading and installing Bootstrap $1
bower install bootstrap\#$1
mkdir app/bower_components/bootstrap-$1
cp -r app/bower_components/bootstrap/* app/bower_components/bootstrap-$1
fi
}
# $1 = bower name $2 = version
# We will build from directory angular-ui-bootstrap, which no version is named (I think)
function InstallUIBootstrap {
if [ -d "app/bower_components/$1-$2" ]; then
echo Using existing copy of $1 $2
cp -r app/bower_components/$1-$2/* app/bower_components/$1
else
echo Downloading and installing Bootstrap UI $2
bower install $1\#$2
mkdir app/bower_components/$1-$2
cp -r app/bower_components/$1/* app/bower_components/$1-$2
fi
}
function InstallSelect2CSS {
if [ -d "app/bower_components/select2-bootstrap-css-$1" ]; then
echo Using existing copy of select2-bootstrap-css $1
cp -r app/bower_components/select2-bootstrap-css-$1/* app/bower_components/select2-bootstrap-css
else
echo Downloading and installing select2-bootstrap-css $1
bower install select2-bootstrap-css\#$1
mkdir app/bower_components/select2-bootstrap-css-$1
cp -r app/bower_components/select2-bootstrap-css/* app/bower_components/select2-bootstrap-css-$1
fi
}
Clear
if [ $1 ]; then
case "$1" in
"bs2" )
InstallBootstrap "2.3.2"
InstallUIBootstrap "angular-ui-bootstrap-bower" "0.8.0"
InstallSelect2CSS "1.2.0"
InstallBootstrap "2.3.2"
;;
"bs3" )
InstallBootstrap "3.1.1"
InstallUIBootstrap "angular-ui-bootstrap-bower" "0.11.0"
InstallSelect2CSS "1.3.0"
InstallBootstrap "3.1.1"
;;
* )
echo "Invalid option $1"
;;
esac
echo Generating css
grunt less:$1
else
echo ""
echo Usage: framework [bs2, bs3]
echo ""
fi