-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.sh
executable file
·58 lines (46 loc) · 1.35 KB
/
build.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
#!/bin/sh
NAME="cell-maps"
BP=build
rm -rf $BP
mkdir -p $BP
mkdir -p $BP/tmp
mkdir -p $BP/fonts
mkdir -p $BP/fontawesome
mkdir -p $BP/images
mkdir -p $BP/css
vulcanize \
--inline-scripts \
--inline-css \
--strip-comments \
src/$NAME-element.html > $BP/tmp/build.html
crisper \
--source $BP/tmp/build.html \
--html $BP/tmp/$NAME-element.html \
--js $BP/tmp/$NAME.js
uglifyjs $BP/tmp/$NAME.js > $BP/tmp/$NAME.min.js
sed -i s@$NAME.js@$NAME.min.js@g $BP/tmp/$NAME-element.html
rm -rf $BP/tmp/build.html
cp COPYING $BP/
cp README.md $BP/
mv $BP/tmp/$NAME-element.html $BP/
mv $BP/tmp/$NAME.js $BP/
mv $BP/tmp/$NAME.min.js $BP/
cp -r conf $BP/
cp -r example-files $BP/
cp -r $NAME-index.html $BP/index.html
#
# fix index.html paths
#
sed -i s@lib/jsorolla/styles/@@g $BP/index.html
cp -r lib/jsorolla/styles/fonts/* $BP/fonts/
sed -i s@bower_components/@@g $BP/index.html
cp -r bower_components/fontawesome/css $BP/fontawesome/
cp -r bower_components/fontawesome/fonts $BP/fontawesome/
cp -r bower_components/webcomponentsjs $BP/
sed -i s@lib/jsorolla/src/lib/components/@css/@g $BP/index.html
cp -r lib/jsorolla/src/lib/components/jso-global.css $BP/css/
cp -r lib/jsorolla/src/lib/components/jso-form.css $BP/css/
cp -r lib/jsorolla/src/lib/components/jso-dropdown.css $BP/css/
sed -i s@src/@@g $BP/index.html
## end fix paths
rm -rf $BP/tmp