refractor: generate missing MacOS specific icns

This commit is contained in:
2026-03-25 07:16:45 +01:00
parent 778a3fc258
commit 4c718b625f
3 changed files with 36 additions and 3 deletions

View File

@@ -11,8 +11,8 @@
"helper:windows-x64": "bash ./scripts/build-tunnel-helper.sh x86_64-pc-windows-msvc", "helper:windows-x64": "bash ./scripts/build-tunnel-helper.sh x86_64-pc-windows-msvc",
"helper:macos-arm64": "bash ./scripts/build-tunnel-helper.sh aarch64-apple-darwin", "helper:macos-arm64": "bash ./scripts/build-tunnel-helper.sh aarch64-apple-darwin",
"helper:macos-x64": "bash ./scripts/build-tunnel-helper.sh x86_64-apple-darwin", "helper:macos-x64": "bash ./scripts/build-tunnel-helper.sh x86_64-apple-darwin",
"tauri:build:macos-arm64": "tauri build --target aarch64-apple-darwin --config src-tauri/tauri.macos.conf.json", "tauri:build:macos-arm64": "bash ./scripts/gen-icns.sh && tauri build --target aarch64-apple-darwin --config src-tauri/tauri.macos.conf.json",
"tauri:build:macos-x64": "tauri build --target x86_64-apple-darwin --config src-tauri/tauri.macos.conf.json", "tauri:build:macos-x64": "bash ./scripts/gen-icns.sh && tauri build --target x86_64-apple-darwin --config src-tauri/tauri.macos.conf.json",
"tauri:build:windows-x64:linux": "chmod +x ./scripts/cargo-xwin ./scripts/clang-cl && PATH=\"$PWD/scripts:$PATH\" XWIN_ARCH=x86_64 tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc --config src-tauri/tauri.windows.conf.json" "tauri:build:windows-x64:linux": "chmod +x ./scripts/cargo-xwin ./scripts/clang-cl && PATH=\"$PWD/scripts:$PATH\" XWIN_ARCH=x86_64 tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc --config src-tauri/tauri.windows.conf.json"
}, },
"dependencies": { "dependencies": {

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -eu
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
ICONS_DIR="${ROOT_DIR}/src-tauri/icons"
ICONSET="${ICONS_DIR}/icon.iconset"
SOURCE="${ICONS_DIR}/icon.png"
OUTPUT="${ICONS_DIR}/icon.icns"
if [ -f "${OUTPUT}" ]; then
echo "icon.icns already exists, skipping generation."
exit 0
fi
echo "Generating ${OUTPUT} from ${SOURCE}..."
mkdir -p "${ICONSET}"
sips -z 16 16 "${SOURCE}" --out "${ICONSET}/icon_16x16.png"
sips -z 32 32 "${SOURCE}" --out "${ICONSET}/icon_16x16@2x.png"
sips -z 32 32 "${SOURCE}" --out "${ICONSET}/icon_32x32.png"
sips -z 64 64 "${SOURCE}" --out "${ICONSET}/icon_32x32@2x.png"
sips -z 128 128 "${SOURCE}" --out "${ICONSET}/icon_128x128.png"
sips -z 256 256 "${SOURCE}" --out "${ICONSET}/icon_128x128@2x.png"
sips -z 256 256 "${SOURCE}" --out "${ICONSET}/icon_256x256.png"
sips -z 512 512 "${SOURCE}" --out "${ICONSET}/icon_256x256@2x.png"
sips -z 512 512 "${SOURCE}" --out "${ICONSET}/icon_512x512.png"
sips -z 1024 1024 "${SOURCE}" --out "${ICONSET}/icon_512x512@2x.png"
iconutil -c icns "${ICONSET}" -o "${OUTPUT}"
rm -rf "${ICONSET}"
echo "Generated ${OUTPUT}"

View File

@@ -12,4 +12,4 @@
"minimumSystemVersion": "11.0" "minimumSystemVersion": "11.0"
} }
} }
} }