fix create macos bundle

This commit is contained in:
Uladzimir Karpenka
2026-06-25 15:30:02 +03:00
parent ec8e707354
commit e99dc7266f
+5 -3
View File
@@ -11,12 +11,14 @@
set -euo pipefail set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Project root holds bin/, icon/, dist/. This script lives in other/, so go up one.
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
# ── Locate source .app ──────────────────────────────────────────────────────── # ── Locate source .app ────────────────────────────────────────────────────────
if [[ $# -ge 1 ]]; then if [[ $# -ge 1 ]]; then
SRC_APP="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" SRC_APP="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
else else
SRC_APP="$(find "$SCRIPT_DIR/bin" -maxdepth 3 -name "*.app" | head -1)" SRC_APP="$(find "$PROJECT_ROOT/bin" -maxdepth 3 -name "*.app" | head -1)"
[[ -n "$SRC_APP" ]] || { echo "ERROR: no .app found under bin/"; exit 1; } [[ -n "$SRC_APP" ]] || { echo "ERROR: no .app found under bin/"; exit 1; }
fi fi
@@ -24,14 +26,14 @@ fi
if [[ $# -ge 2 ]]; then if [[ $# -ge 2 ]]; then
OUT_DIR="$2" OUT_DIR="$2"
else else
OUT_DIR="$SCRIPT_DIR/dist" OUT_DIR="$PROJECT_ROOT/dist"
fi fi
mkdir -p "$OUT_DIR" mkdir -p "$OUT_DIR"
# ── Generate .icns from icon/ folder ───────────────────────────────────────── # ── Generate .icns from icon/ folder ─────────────────────────────────────────
ICNS_PATH="" ICNS_PATH=""
ICON_SRC="$SCRIPT_DIR/icon" ICON_SRC="$PROJECT_ROOT/icon"
if [[ -d "$ICON_SRC" ]]; then if [[ -d "$ICON_SRC" ]]; then
echo "Generating EWSDR.icns..." echo "Generating EWSDR.icns..."
ICONSET_TMP="$(mktemp -d)/EWSDR.iconset" ICONSET_TMP="$(mktemp -d)/EWSDR.iconset"