]> git.openstreetmap.org Git - nominatim-ui.git/blob - build.sh
219175bb5e6c1e33d913230b586e8f970fe91539
[nominatim-ui.git] / build.sh
1 #!/bin/bash
2
3 mkdir -p dist/assets/
4 rsync --quiet --recursive src/assets/css/ dist/assets/css/
5 rsync --quiet --recursive src/assets/images/ dist/assets/images/
6
7 mkdir -p dist/assets/js/
8 cat src/assets/js/base.js src/assets/js/detailpage.js src/assets/js/searchpage.js > dist/assets/js/nominatim-ui.js
9
10 rsync --quiet --recursive src/vendor/js/* dist/assets/js/
11 rsync --quiet --recursive node_modules/jquery/dist/jquery.min.js dist/assets/js/
12 rsync --quiet --recursive node_modules/leaflet/dist/leaflet.js dist/assets/js/
13 rsync --quiet --recursive node_modules/leaflet/dist/leaflet.js.map dist/assets/js/
14 rsync --quiet --recursive node_modules/leaflet/dist/leaflet.css dist/assets/css/
15 rsync --quiet --recursive node_modules/leaflet/dist/images/ dist/assets/css/images/
16
17 rsync --quiet --recursive node_modules/leaflet-minimap/dist/Control.MiniMap.min.js dist/assets/js/
18 rsync --quiet --recursive node_modules/leaflet-minimap/dist/Control.MiniMap.min.css dist/assets/css/
19 rsync --quiet --recursive node_modules/leaflet-minimap/dist/images/ dist/assets/css/images/
20
21 rsync --quiet --recursive node_modules/bootstrap/dist/js/bootstrap.min.js dist/assets/js/
22 rsync --quiet --recursive node_modules/bootstrap/dist/css/bootstrap.min.css dist/assets/css/
23 rsync --quiet --recursive node_modules/bootstrap/dist/css/bootstrap-theme.min.css dist/assets/css/
24
25 rsync --quiet --recursive node_modules/handlebars/dist/handlebars.min.js dist/assets/js/
26 rsync --quiet --recursive node_modules/@ungap/url-search-params/min.js dist/assets/js/url-search-params.js
27 # rsync --quiet --recursive src/vendor/css/* dist/assets/css/
28 # rsync --quiet --recursive src/vendor/images/* dist/assets/images/
29 rsync --quiet --recursive src/templates dist/
30
31 rsync --quiet src/*.js dist/
32
33
34 cat src/layout.html | perl -pe'use File::Slurper qw(read_text); s/\@include\((.+?)\)/read_text($1)/eg' > /tmp/included.html
35
36 cat /tmp/included.html | perl -pe's/BODYID/search-page/g' > dist/search.html
37 cat /tmp/included.html | perl -pe's/BODYID/reverse-page/g' > dist/reverse.html
38 cat /tmp/included.html | perl -pe's/BODYID/details-page/g' > dist/details.html
39 cp src/index.html dist/