Drag files in Finder, hold a modifier, and drop on a wheel of outputs. Conversions run entirely on-device through ImageIO, PDFKit, AVFoundation, the bundled CLI tools, and optional ffmpeg/LibreOffice. Includes a --self-test suite (41 checks) and a --convert CLI mode so the conversion matrix can be verified without the UI.
30 lines
911 B
Bash
Executable File
30 lines
911 B
Bash
Executable File
#!/bin/bash
|
|
# Builds Icon.icns from scripts/gen-icon.swift and drops it into Konverter.app.
|
|
# Run ./build-app.sh first (this expects the bundle to exist).
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
APP="Konverter.app"
|
|
if [ ! -d "$APP" ]; then
|
|
echo "make-icon.sh: $APP not found — run ./build-app.sh first." >&2
|
|
exit 1
|
|
fi
|
|
|
|
TMP=$(mktemp -d)
|
|
trap 'rm -rf "$TMP"' EXIT
|
|
|
|
swift scripts/gen-icon.swift "$TMP/icon-1024.png"
|
|
|
|
mkdir -p "$TMP/Icon.iconset"
|
|
for s in 16 32 128 256 512; do
|
|
d=$((s * 2))
|
|
sips -z "$s" "$s" "$TMP/icon-1024.png" --out "$TMP/Icon.iconset/icon_${s}x${s}.png" >/dev/null
|
|
sips -z "$d" "$d" "$TMP/icon-1024.png" --out "$TMP/Icon.iconset/icon_${s}x${s}@2x.png" >/dev/null
|
|
done
|
|
|
|
iconutil -c icns "$TMP/Icon.iconset" -o "$TMP/Icon.icns"
|
|
mkdir -p "$APP/Contents/Resources"
|
|
cp "$TMP/Icon.icns" "$APP/Contents/Resources/Icon.icns"
|
|
echo "Generated $APP/Contents/Resources/Icon.icns"
|