diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb6faed8..be7307e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,10 @@ jobs: run: | # Run flutter analyze # Fails on errors or warnings only (info messages are allowed) - flutter analyze 2>&1 | tee analyze_output.txt || true + set +e + flutter analyze 2>&1 | tee analyze_output.txt + analyze_status=${PIPESTATUS[0]} + set -e # Check output for errors or warnings if grep -q "error •" analyze_output.txt; then @@ -61,6 +64,9 @@ jobs: elif grep -q "warning •" analyze_output.txt; then echo "⚠️ Analysis completed with warnings" exit 1 + elif [ "$analyze_status" -ne 0 ] && ! grep -q "info •" analyze_output.txt; then + echo "❌ Analyzer failed before producing diagnostics (exit $analyze_status)" + exit "$analyze_status" else echo "✅ Analysis passed!" exit 0 diff --git a/scripts/generate_android_icons.sh b/scripts/generate_android_icons.sh index 3d988b85..9b73409f 100755 --- a/scripts/generate_android_icons.sh +++ b/scripts/generate_android_icons.sh @@ -23,11 +23,20 @@ if ! command -v rsvg-convert &> /dev/null; then exit 1 fi -if ! command -v magick &> /dev/null && ! command -v convert &> /dev/null; then +if command -v magick &> /dev/null; then + IMAGEMAGICK=magick +elif command -v convert &> /dev/null; then + IMAGEMAGICK=convert +else echo "Error: ImageMagick not found. Install with: brew install imagemagick" exit 1 fi +if ! command -v bc &> /dev/null; then + echo "Error: bc not found. Install with: brew install bc" + exit 1 +fi + # Create temp directory mkdir -p "$TEMP_DIR" @@ -49,7 +58,7 @@ generate_white_icon() { rsvg-convert --keep-aspect-ratio --background-color=transparent "$SVG_SOURCE" -o "$TEMP_DIR/temp_unpadded.png" # Center the image in a square canvas with transparent padding - magick "$TEMP_DIR/temp_unpadded.png" \ + "$IMAGEMAGICK" "$TEMP_DIR/temp_unpadded.png" \ -resize "${size}x${size}" \ -gravity center \ -background transparent \ @@ -61,11 +70,11 @@ generate_white_icon() { fi # Convert to white silhouette: extract alpha, fill with white, apply alpha - magick "$TEMP_DIR/temp.png" \ + "$IMAGEMAGICK" "$TEMP_DIR/temp.png" \ -alpha extract \ "$TEMP_DIR/alpha_mask.png" - magick -size "${size}x${size}" xc:white \ + "$IMAGEMAGICK" -size "${size}x${size}" xc:white \ "$TEMP_DIR/alpha_mask.png" \ -alpha off \ -compose copy-opacity \