This commit is contained in:
vinceliuice
2021-01-25 23:54:41 +08:00
parent 5871779b04
commit 30c1a9162b
227 changed files with 2329 additions and 1089 deletions
+13 -25
View File
@@ -3,36 +3,24 @@
INKSCAPE="/usr/bin/inkscape"
OPTIPNG="/usr/bin/optipng"
if [[ "$1" == "color" ]]; then
cd "assets-color" || exit 1
elif [[ "$1" == "white" ]]; then
cd "assets-white" || exit 1
else
echo "Please use either 'color' or 'white'"
exit 1
fi
if [[ "$2" == "icons" ]]; then
EXPORT_TYPE="icons"
INDEX="../logos.txt"
SRC_FILE="../logos-$1.svg"
elif [[ "$2" == "select" ]]; then
if [[ "$1" == "select" ]]; then
EXPORT_TYPE="select"
INDEX="../select.txt"
SRC_FILE="../select.svg"
INDEX="select.txt"
SRC_FILE="select.svg"
else
echo "Please use either 'icons' or 'select'"
exit 1
EXPORT_TYPE="icons"
INDEX="logos.txt"
SRC_FILE="logos-$1.svg"
fi
if [[ "$3" == "1080p" ]]; then
ASSETS_DIR="$EXPORT_TYPE-1080p"
if [[ "$2" == "1080p" ]]; then
ASSETS_DIR="assets-$1/$EXPORT_TYPE-1080p"
EXPORT_DPI="96"
elif [[ "$3" == "2k" ]] || [[ "$3" == "2K" ]]; then
ASSETS_DIR="$EXPORT_TYPE-2k"
elif [[ "$2" == "2k" ]] || [[ "$2" == "2K" ]]; then
ASSETS_DIR="assets-$1/$EXPORT_TYPE-2k"
EXPORT_DPI="144"
elif [[ "$3" == "4k" ]] || [[ "$3" == "4K" ]]; then
ASSETS_DIR="$EXPORT_TYPE-4k"
elif [[ "$2" == "4k" ]] || [[ "$2" == "4K" ]]; then
ASSETS_DIR="assets-$1/$EXPORT_TYPE-4k"
EXPORT_DPI="192"
else
echo "Please use either '1080p', '2k' or '4k'"
@@ -52,7 +40,7 @@ while read -r i; do
"--export-dpi=$EXPORT_DPI" \
"--export-id-only" \
"--export-filename=$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null
#$OPTIPNG -o7 --quiet "$ASSETS_DIR/$i.png"
$OPTIPNG -o7 --quiet "$ASSETS_DIR/$i.png"
fi
done < "$INDEX"