forked from subchen/angular-async-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.sh
executable file
·78 lines (57 loc) · 1.84 KB
/
make.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
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
set -e
appdir=$(cd $(dirname $0); pwd)
clean() {
rm -rf $appdir/node_modules
rm -rf $appdir/demo/node_modules
}
install() {
cd $appdir
if [ ! -f "./node_modules/.bin/uglifyjs" ]; then
npm install uglifyjs
fi
./node_modules/.bin/uglifyjs \
angular-async-loader.js -c -m \
-o angular-async-loader.min.js \
--source-map angular-async-loader.min.js.map
cd $appdir/demo
if [ ! -d "./node_modules" ]; then
npm install
mkdir -p assets/requirejs/
cp node_modules/requirejs/require.js assets/requirejs/
mkdir -p assets/angular/
cp node_modules/angular/angular.min.js assets/angular/
mkdir -p assets/angular-ui-router/release/
cp node_modules/angular-ui-router/release/angular-ui-router.min.js assets/angular-ui-router/release/
mkdir -p assets/angular-ui-mask/dist/
cp node_modules/angular-ui-mask/dist/mask.min.js assets/angular-ui-mask/dist/
mkdir -p assets/ng-tags-input/build/
cp node_modules/ng-tags-input/build/ng-tags-input.min.js assets/ng-tags-input/build/
cp node_modules/ng-tags-input/build/ng-tags-input.min.css assets/ng-tags-input/build/
mkdir -p assets/ng-file-upload/dist/
cp node_modules/ng-file-upload/dist/ng-file-upload-all.min.js assets/ng-file-upload/dist/
fi
mkdir -p assets/angular-async-loader/
cp ../angular-async-loader.min.js assets/angular-async-loader/
}
test() {
cd $appdir
if [ ! -f "./node_modules/.bin/browser-sync" ]; then
npm install browser-sync
fi
./node_modules/.bin/browser-sync start -s demo --files demo
}
case "$1" in
clean)
clean
;;
install)
install
;;
test)
test
;;
*)
echo "Usage: $0 { clean | install | test }"
exit 1
esac