Files
TimeTracker/scripts/generate-mobile-icon.sh
T
Dries Peeters 94fc19f6f2 Build: add icon generation to CI and scripts, bump version to 4.16.0
- Run app icon and launcher icon generation in build-mobile workflow
- Add generate-mobile-icon scripts (Python/Pillow, ImageMagick, Inkscape)
- BUILD.md: document icon requirements and troubleshooting
- setup.py: version 4.16.0

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-01 16:51:13 +01:00

29 lines
838 B
Bash

#!/bin/bash
# Generate mobile app icon (app_icon.png) from SVG or Python fallback.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
SVG="$PROJECT_ROOT/app/static/images/timetracker-logo-icon.svg"
OUT="$PROJECT_ROOT/mobile/assets/icon/app_icon.png"
mkdir -p "$(dirname "$OUT")"
# Try ImageMagick first (exact SVG export)
if command -v magick &> /dev/null; then
if magick "$SVG" -resize 1024x1024 "$OUT"; then
echo "Generated app_icon.png with ImageMagick"
exit 0
fi
fi
# Try Inkscape
if command -v inkscape &> /dev/null; then
if inkscape "$SVG" -w 1024 -h 1024 -o "$OUT"; then
echo "Generated app_icon.png with Inkscape"
exit 0
fi
fi
# Fallback: Python script (requires Pillow)
python3 "$SCRIPT_DIR/generate-mobile-icon.py"
exit $?