awtk/scripts/create_assets_zip.sh

59 lines
609 B
Bash
Raw Permalink Normal View History

2020-02-27 18:35:18 +08:00
#!/bin/bash
2021-09-13 18:17:00 +08:00
if [ "$1" == "" ]
then
SRC=res/assets
else
SRC="$1"
fi
2024-11-03 12:11:55 +08:00
if [ "$2" == "" ]
then
DST="../assets.zip"
else
DST="$2"
fi
2021-09-13 18:17:00 +08:00
echo "SRC=$SRC"
2024-11-03 12:11:55 +08:00
echo "DST=$DST"
2020-02-27 18:35:18 +08:00
2021-07-11 16:42:44 +08:00
if [ -e "$SRC" ]
then
echo "preparing..."
else
2024-11-03 12:11:55 +08:00
echo "$SRC not exists"
2021-07-11 16:42:44 +08:00
exit 0
fi
2020-02-27 18:35:18 +08:00
rm -rf temp
2024-11-03 12:11:55 +08:00
rm -f $DST
2020-02-27 18:35:18 +08:00
mkdir temp
cp -rf "$SRC" temp
cd temp/assets
2024-11-03 12:11:55 +08:00
rm -f *.inc
2020-02-27 18:35:18 +08:00
for f in *;
do
if [ -d $f ]
then
echo "clean " $f;
2024-11-03 12:11:55 +08:00
rm -rf $f/inc
rm -rf $f/raw/ui/*.xml
rm -rf $f/raw/styles/*.xml
rm -rf $f/raw/strings/*.xml
2020-02-27 18:35:18 +08:00
fi
done
cd ..
2024-11-05 16:53:55 +08:00
zip -r $DST assets
echo "assets saved to $DST:"
ls -l $DST
2020-02-27 18:35:18 +08:00
cd ..
rm -rf temp