2013-03-18 16:48:50 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-03-21 10:50:13 +00:00
|
|
|
set -e
|
|
|
|
|
2013-03-18 16:48:50 +00:00
|
|
|
cat <<EOF
|
|
|
|
package blob
|
|
|
|
var files = map [string] map [string] []byte {
|
|
|
|
EOF
|
|
|
|
|
2013-03-21 10:50:13 +00:00
|
|
|
ORIGINAL_PWD=${PWD}
|
|
|
|
|
2013-03-18 16:48:50 +00:00
|
|
|
for dir in $@
|
|
|
|
do
|
2013-03-21 10:50:13 +00:00
|
|
|
cd "${dir}"
|
|
|
|
echo "\"$(basename ${dir})\": {"
|
2013-03-18 16:48:50 +00:00
|
|
|
|
2013-03-21 10:50:13 +00:00
|
|
|
find . -type f | while read file
|
2013-03-18 16:48:50 +00:00
|
|
|
do
|
2013-03-21 10:50:13 +00:00
|
|
|
name=$(echo "${file}"|sed 's|\.\/||')
|
2013-03-20 11:31:42 +00:00
|
|
|
echo "\"$name\": {"
|
2013-03-21 10:50:13 +00:00
|
|
|
gzip -9 -c "${file}" | xxd -p |sed 's/\(..\)/0x\1, /g'
|
2013-03-20 11:31:42 +00:00
|
|
|
echo "},"
|
2013-03-18 16:48:50 +00:00
|
|
|
echo
|
|
|
|
done
|
2013-03-20 11:31:42 +00:00
|
|
|
echo "},"
|
2013-03-21 10:50:13 +00:00
|
|
|
cd "${ORIGINAL_PWD}"
|
2013-03-18 16:48:50 +00:00
|
|
|
done
|
|
|
|
echo '}'
|