mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-14 01:24:04 -08:00
7e5745fe0e
- Use only the minified versions of bootstrap. - Do not embed non-minified bootstrap files and bootstrap map files. - Simplify the 'blob-stamp' Makefile contraption.
30 lines
581 B
Bash
Executable file
30 lines
581 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
cat <<EOF
|
|
package blob
|
|
var files = map [string] map [string] []byte {
|
|
EOF
|
|
|
|
ORIGINAL_PWD=${PWD}
|
|
|
|
for dir in $@
|
|
do
|
|
cd "${dir}"
|
|
echo "\"$(basename ${dir})\": {"
|
|
|
|
# Do not embed map files and the non-minified bootstrap files.
|
|
find . -type f \! -name \*.map \! -name bootstrap.js \! -name bootstrap-theme.css \! -name bootstrap.css | while read file
|
|
do
|
|
name=$(echo "${file}"|sed 's|\.\/||')
|
|
echo "\"$name\": {"
|
|
gzip -9 -c "${file}" | xxd -p |sed 's/\(..\)/0x\1, /g'
|
|
echo "},"
|
|
echo
|
|
done
|
|
echo "},"
|
|
cd "${ORIGINAL_PWD}"
|
|
done
|
|
echo '}'
|