SPB Git

Repository Public

render.sh 1.3 KB 47 lines shellscript

1#!/bin/bash2# Regenerates every PNG export and the Xcode AppIcon set from the SVG sources.3# Requires rsvg-convert (brew install librsvg). Run from anywhere.4set -euo pipefail5BRAND="$(cd "$(dirname "$0")" && pwd)"6ROOT="$(cd "$BRAND/../.." && pwd)"7EXPORTS="$BRAND/Exports"8ICONSET="$ROOT/Resources/Assets.xcassets/AppIcon.appiconset"9RSVG="$(command -v rsvg-convert || echo /opt/homebrew/bin/rsvg-convert)"10MASTER="$BRAND/SPTermIcon.svg"11SMALL="$BRAND/SPTermIcon-small.svg"   # simplified drawing, used at 16 and 32 px1213mkdir -p "$EXPORTS" "$ICONSET"1415src_for() { if [ "$1" -le 32 ]; then echo "$SMALL"; else echo "$MASTER"; fi; }16render() { "$RSVG" -w "$1" -h "$1" "$(src_for "$1")" -o "$2"; }1718for px in 1024 512 256 128 64 32 16; do19  render "$px" "$EXPORTS/SPTermIcon-$px.png"20done2122# concept previews23for c in a b c; do24  for px in 1024 128 32 16; do25    "$RSVG" -w "$px" -h "$px" "$BRAND/Concepts/concept-$c.svg" -o "$BRAND/Concepts/concept-$c-$px.png"26  done27done2829# macOS app icon set: <points> <scale> <pixels>30while read -r pt scale px; do31  suffix=""; [ "$scale" = 2 ] && suffix="@2x"32  cp "$EXPORTS/SPTermIcon-$px.png" "$ICONSET/icon_${pt}x${pt}${suffix}.png"33done <<LIST3416 1 163516 2 323632 1 323732 2 6438128 1 12839128 2 25640256 1 25641256 2 51242512 1 51243512 2 102444LIST45echo "Rendered exports -> $EXPORTS"46echo "Rendered app icon -> $ICONSET"47
Files main
Menu

Theme