-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy
executable file
·39 lines (30 loc) · 982 Bytes
/
deploy
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
#!/bin/bash
#
# You must run this each time a config file in /public/config has changed. It generates
# status.js in src/js/modules/_config and is used to determine when a config file needs
# to be fetched from the server rather than used from local storage
#
# Run ./deploy and make sure npm start is running, if not start it so the js bundles will
# be updated with the new version of status.js created by this script.
#
configDir="public/config"
# source location
statusFileName="src/js/modules/_config/status.js"
# name of all book config files
#
# CHANGE THIS LIST TO REFLECT ALL CONFIG FILES IN PUBLIC/CONFIG
configFiles="acq early tjl woh wok wos wot"
((cnt=0))
status="export const status = {"
for i in $configFiles; do
dt=`date -r ${configDir}/${i}.json`
if (( cnt > 0 )); then
status="${status}, ${i}: \"${dt}\""
else
status="${status}${i}: \"${dt}\""
fi
((cnt = cnt + 1))
done
status="${status}};"
echo $status
echo $status > ${statusFileName}