mirror of
https://github.com/prometheus/prometheus
synced 2024-12-29 18:22:16 +00:00
8358e5ee44
Mac OS X (shudder) needs to have a slightly modified find execution pattern.
29 lines
426 B
Bash
Executable File
29 lines
426 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})\": {"
|
|
|
|
find . -type f | 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 '}'
|