]> git.openstreetmap.org Git - nominatim-ui.git/blob - build.sh
Merge pull request #3 from mtmail/dependabot/npm_and_yarn/handlebars-4.1.2
[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 node_modules/jquery/dist/jquery.min.js dist/assets/js/
11 rsync --quiet node_modules/leaflet/dist/leaflet.js dist/assets/js/
12 rsync --quiet node_modules/leaflet/dist/leaflet.js.map dist/assets/js/
13 rsync --quiet node_modules/leaflet/dist/leaflet.css dist/assets/css/
14 rsync --quiet node_modules/leaflet/dist/images/* dist/assets/css/images/
15
16 rsync --quiet node_modules/leaflet-minimap/dist/Control.MiniMap.min.js dist/assets/js/
17 rsync --quiet node_modules/leaflet-minimap/dist/Control.MiniMap.min.css dist/assets/css/
18 rsync --quiet node_modules/leaflet-minimap/dist/images/* dist/assets/css/images/
19
20 rsync --quiet node_modules/bootstrap/dist/js/bootstrap.min.js dist/assets/js/
21 rsync --quiet node_modules/bootstrap/dist/css/bootstrap.min.css dist/assets/css/
22 rsync --quiet node_modules/bootstrap/dist/css/bootstrap-theme.min.css dist/assets/css/
23
24 rsync --quiet node_modules/handlebars/dist/handlebars.min.js dist/assets/js/
25 rsync --quiet node_modules/@ungap/url-search-params/min.js dist/assets/js/url-search-params.js
26 rsync --quiet src/templates/*.hbs dist/
27
28 rsync --quiet src/*.js dist/
29
30
31 cat src/layout.html | perl -pe'use File::Slurper qw(read_text); s/\@include\((.+?)\)/read_text($1)/eg' > /tmp/included.html
32
33 cat /tmp/included.html | perl -pe's/BODYID/search-page/g' > dist/search.html
34 cat /tmp/included.html | perl -pe's/BODYID/reverse-page/g' > dist/reverse.html
35 cat /tmp/included.html | perl -pe's/BODYID/details-page/g' > dist/details.html
36 cp src/index.html dist/