mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-05 20:36:13 +02:00
Merge pull request #88 from prometheus/feature/scraping/named-target-state
Update embedding script to support BSD find.
This commit is contained in:
commit
33c855e9bd
@ -1,25 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cat <<EOF
|
||||
package blob
|
||||
var files = map [string] map [string] []byte {
|
||||
EOF
|
||||
|
||||
CDIR=`pwd`
|
||||
ORIGINAL_PWD=${PWD}
|
||||
|
||||
for dir in $@
|
||||
do
|
||||
cd "$dir"
|
||||
echo "\"`basename $dir`\": {"
|
||||
cd "${dir}"
|
||||
echo "\"$(basename ${dir})\": {"
|
||||
|
||||
find -type f | while read file
|
||||
find . -type f | while read file
|
||||
do
|
||||
name=`echo "$file"|sed 's|\.\/||'`
|
||||
name=$(echo "${file}"|sed 's|\.\/||')
|
||||
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
|
||||
done
|
||||
echo "},"
|
||||
cd $CDIR
|
||||
cd "${ORIGINAL_PWD}"
|
||||
done
|
||||
echo '}'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user