mirror of https://github.com/prometheus/prometheus
Mac OS X (shudder) needs to have a slightly modified find execution pattern.pull/88/head
parent
1f80b17cb7
commit
8358e5ee44
@ -1,25 +1,28 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
package blob
|
package blob
|
||||||
var files = map [string] map [string] []byte {
|
var files = map [string] map [string] []byte {
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
CDIR=`pwd`
|
ORIGINAL_PWD=${PWD}
|
||||||
|
|
||||||
for dir in $@
|
for dir in $@
|
||||||
do
|
do
|
||||||
cd "$dir"
|
cd "${dir}"
|
||||||
echo "\"`basename $dir`\": {"
|
echo "\"$(basename ${dir})\": {"
|
||||||
|
|
||||||
find -type f | while read file
|
find . -type f | while read file
|
||||||
do
|
do
|
||||||
name=`echo "$file"|sed 's|\.\/||'`
|
name=$(echo "${file}"|sed 's|\.\/||')
|
||||||
echo "\"$name\": {"
|
echo "\"$name\": {"
|
||||||
gzip -9 -c "$file" | xxd -p |sed 's/\(..\)/0x\1, /g'
|
gzip -9 -c "${file}" | xxd -p |sed 's/\(..\)/0x\1, /g'
|
||||||
echo "},"
|
echo "},"
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
echo "},"
|
echo "},"
|
||||||
cd $CDIR
|
cd "${ORIGINAL_PWD}"
|
||||||
done
|
done
|
||||||
echo '}'
|
echo '}'
|
||||||
|
Loading…
Reference in new issue