mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 20:17:03 +00:00
feat(bar): bundle a macOS app icon
Generate AppIcon.icns from the CCS mark at package time (sips + iconutil) and reference it via CFBundleIconFile so Finder, Spotlight, and the Dock show the brand icon instead of a blank bundle. Refs #1525
This commit is contained in:
1 parent
e26f294124
commit
30ed7c42b1
3 files changed
+25
No files matched your search
@@ -42,6 +42,29 @@ if [[ -d "$ROOT/Resources/Assets" ]]; then
|
||||
cp "$ROOT/Resources/Assets/"*.png "$APP/Contents/Resources/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Build AppIcon.icns from AppIcon-source.png (1024x1024 RGBA PNG).
|
||||
ICON_SRC="$ROOT/Resources/AppIcon-source.png"
|
||||
if [[ -f "$ICON_SRC" ]]; then
|
||||
echo "[i] Building AppIcon.icns..."
|
||||
ICONSET_DIR="$(mktemp -d)/AppIcon.iconset"
|
||||
mkdir -p "$ICONSET_DIR"
|
||||
sips -z 16 16 "$ICON_SRC" --out "$ICONSET_DIR/icon_16x16.png" > /dev/null
|
||||
sips -z 32 32 "$ICON_SRC" --out "$ICONSET_DIR/icon_16x16@2x.png" > /dev/null
|
||||
sips -z 32 32 "$ICON_SRC" --out "$ICONSET_DIR/icon_32x32.png" > /dev/null
|
||||
sips -z 64 64 "$ICON_SRC" --out "$ICONSET_DIR/icon_32x32@2x.png" > /dev/null
|
||||
sips -z 128 128 "$ICON_SRC" --out "$ICONSET_DIR/icon_128x128.png" > /dev/null
|
||||
sips -z 256 256 "$ICON_SRC" --out "$ICONSET_DIR/icon_128x128@2x.png" > /dev/null
|
||||
sips -z 256 256 "$ICON_SRC" --out "$ICONSET_DIR/icon_256x256.png" > /dev/null
|
||||
sips -z 512 512 "$ICON_SRC" --out "$ICONSET_DIR/icon_256x256@2x.png" > /dev/null
|
||||
sips -z 512 512 "$ICON_SRC" --out "$ICONSET_DIR/icon_512x512.png" > /dev/null
|
||||
sips -z 1024 1024 "$ICON_SRC" --out "$ICONSET_DIR/icon_512x512@2x.png" > /dev/null
|
||||
iconutil -c icns "$ICONSET_DIR" -o "$APP/Contents/Resources/AppIcon.icns"
|
||||
rm -rf "$(dirname "$ICONSET_DIR")"
|
||||
echo "[OK] AppIcon.icns built."
|
||||
else
|
||||
echo "[!] AppIcon-source.png not found at $ICON_SRC — skipping icon." >&2
|
||||
fi
|
||||
|
||||
echo "[i] Signing ($SIGNING)..."
|
||||
case "$SIGNING" in
|
||||
adhoc)
|
||||
|
||||
Reference in new issue
Block a user