-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate
executable file
·46 lines (39 loc) · 852 Bytes
/
update
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
#!/bin/bash
#
# Update CDT'23 in guillaumeportails.github.io
dst=cdt23
src=../hikit
(cd $src; ./build.sh)
# Minify carte
# + "--js-precision 5" is 5 digits, relative precision (left and right of comma)
# but here we want 1e-5 deg = 1m. Then $src/json2js is safer
minify -b -o $dst/carte.js $src/tracks/*.js $src/carte.js
# Minify others
for f in \
index.html \
drive.js \
flex.css \
icon-camp.png \
icon-cross.png \
icon-home.png \
icon-target.png \
icon-walk.png \
leaflet.filelayer.js \
logo.png \
tracks/feed.kml
do
if [ ! -f $src/$f ]; then
echo "$src/$f notfound"
continue
fi
mkdir -p $dst/$(dirname $f)
e=${f##*.}
if [[ "$e" == "js" || "$e" == "html" || "$e" == "css" ]]; then
echo "Minifying $f"
minify $src/$f > $dst/$f
else
echo "Copying $f"
cp -r $src/$f $dst
fi
done
ls -lR cdt23