-
Notifications
You must be signed in to change notification settings - Fork 3
/
postinstall.sh
59 lines (48 loc) · 2.05 KB
/
postinstall.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
#!/bin/bash
echo '*************************************************************************'
echo POSTINSTALL
echo '*************************************************************************'
#echo '*************************************************************************'
#echo These directoies need to exist in dist, even if you don't have them in your project
#echo '*************************************************************************'
mkdir -p dist/events
mkdir -p dist/routes
mkdir -p dist/socket-apis
mkdir -p dist/web-components
#
# assets is where static files go
#
mkdir -p ./assets/js/
# socket.io-streams requires a static load of this file, so we put it in assets
cp node_modules/civil-server/node_modules/socket.io-stream/socket.io-stream.js ./assets/js/
# you can start with the favicon images from civil-server - but you may want to replace them with your own some day
mkdir -p ./assets/images
cp -r node_modules/civil-server/assets/images ./assets/images
mkdir -p ./assets/css
cp ./node_modules/react-perfect-scrollbar/dist/css/styles.css assets/css/react-perfect-scrollbar.css
echo '***'
echo Svgr
echo '***'
npm run svgr
#
# Update/create web-components/index.js to require all react components in that director, and in the listed child/peer directories
#
node node_modules/civil-server/dist/tools/react-directory-indexer.js app/web-components/ node_modules/civil-server/dist/web-components/
node node_modules/civil-server/dist/tools/react-directory-indexer.js --data app/data-components/ node_modules/civil-server/dist/data-components/
#echo '*************************************************************************'
#echo TRANSPILE
#echo '*************#************************************************************'
#
npm run transpile || {
echo Could not transpile;
exit 1
}
echo "transpile ok"
#echo '*************************************************************************'
#echo WEBPACK
#echo '*************************************************************************'
npm run packbuild || {
echo Could not webpack;
exit 1
}
echo "webpack ok"