Fix make_mapping on files with spaces

This commit is contained in:
Varun Patil 2020-10-20 11:55:29 +05:30
parent cc21a7a66c
commit 0f77118c06
1 changed files with 6 additions and 9 deletions

View File

@ -3,23 +3,16 @@
echo "var mapping = {" > mapping.js
echo "var bitmapSizeMapping = {" > bitmap-map.js
for file in {*,*/*,*/**/*}
for file in {*,*/*,*/**/*,*/**/**/*}
do
filename="${file%.*}"
fl="$(echo "$filename" | tr '[:upper:]' '[:lower:]')"
if [ -f $file ]
if [ -f "${file}" ]
then
md5=`md5sum "${file}" | awk '{ print $1 }'`
else
md5=''
fi
echo "\"$fl\": \"${file}?h=${md5}\"," >> mapping.js
if [ -f $file ]
then
sz=`identify -format "%w,%h" "${file}" 2>/dev/null`
if [ $? -eq 0 ]; then
convert "$file" -resize 64x64\> "conv.png"
@ -30,8 +23,12 @@ then
echo "\"$fl\": [${sz},\"${duri}\"]," >> bitmap-map.js
fi
else
md5=''
fi
echo "\"$fl\": \"${file}?h=${md5}\"," >> mapping.js
done
echo "};" >> mapping.js