You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.5 KiB
Bash
52 lines
1.5 KiB
Bash
#! /usr/bin/env bash
|
|
|
|
RENDER_SVG="$(command -v rendersvg)" || true
|
|
INKSCAPE="$(command -v inkscape)" || true
|
|
OPTIPNG="$(command -v optipng)" || true
|
|
|
|
INDEX="assets.txt"
|
|
|
|
./make-assets.sh
|
|
|
|
for theme in '' '-Purple' '-Pink' '-Red' '-Orange' '-Yellow' '-Green' '-Teal' '-Nord' '-Grey'; do
|
|
for color in '' '-Dark'; do
|
|
ASSETS_DIR="assets${theme}${color}"
|
|
SRC_FILE="assets${theme}${color}.svg"
|
|
|
|
# [[ -d $ASSETS_DIR ]] && rm -rf $ASSETS_DIR
|
|
mkdir -p $ASSETS_DIR
|
|
|
|
for i in `cat $INDEX`; do
|
|
if [[ -f "$ASSETS_DIR/$i.png" ]]; then
|
|
echo "'$ASSETS_DIR/$i.png' exists."
|
|
else
|
|
echo "Rendering '$ASSETS_DIR/$i.png'"
|
|
if [[ -n "${RENDER_SVG}" ]]; then
|
|
"$RENDER_SVG" --export-id "$i" \
|
|
"$SRC_FILE" "$ASSETS_DIR/$i.png"
|
|
else
|
|
"$INKSCAPE" --export-id="$i" \
|
|
--export-id-only \
|
|
--export-filename="$ASSETS_DIR/$i.png" "$SRC_FILE" >/dev/null
|
|
fi
|
|
if [[ -n "${OPTIPNG}" ]]; then
|
|
"$OPTIPNG" -o7 --quiet "$ASSETS_DIR/$i.png"
|
|
fi
|
|
fi
|
|
done
|
|
done
|
|
done
|
|
|
|
for theme in '' '-Purple' '-Pink' '-Red' '-Orange' '-Yellow' '-Green' '-Teal' '-Nord' '-Grey'; do
|
|
for color in '' '-Dark'; do
|
|
if [[ "${theme}" == '' ]]; then
|
|
echo "keep assets${color}.svg file..."
|
|
else
|
|
ASSETS_FILE="assets${theme}${color}.svg"
|
|
rm -rf "${ASSETS_FILE}"
|
|
fi
|
|
done
|
|
done
|
|
|
|
echo -e "DONE!"
|