mkxp/extra/make_mapping.sh

24 lines
331 B
Bash
Raw Normal View History

2020-05-07 06:57:51 +00:00
#!/bin/bash
echo "var mapping = {" > mapping.js
for file in {*,*/*,*/**/*}
do
filename="${file%.*}"
fl="$(echo "$filename" | tr '[:upper:]' '[:lower:]')"
2020-10-18 19:22:59 +00:00
if [ -f $file ]
then
md5=`md5sum "${file}" | awk '{ print $1 }'`
else
md5=''
fi
2020-05-07 06:57:51 +00:00
echo "\"$fl\": \"${file}?h=${md5}\"," >> mapping.js
done
echo "};" >> mapping.js