46 lines
1.4 KiB
Bash
Executable File
46 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# sync_helder.sh — build Helder (arm64), install it into ~/Applications, and
|
|
# drop a stable-named Helder.dmg alongside it.
|
|
#
|
|
# ./sync_helder.sh
|
|
#
|
|
set -euo pipefail
|
|
|
|
# Run from the repo root (where this script lives), whatever the caller's cwd is.
|
|
cd "$(dirname "$0")"
|
|
|
|
APPS_DIR="$HOME/Applications"
|
|
APP_DEST="$APPS_DIR/Helder.app"
|
|
DMG_DEST="$APPS_DIR/Helder.dmg"
|
|
|
|
echo "▶ Building Helder (arm64)…"
|
|
npm run dist:mac
|
|
|
|
# Locate the freshly built artifacts.
|
|
APP_SRC="dist/mac-arm64/Helder.app"
|
|
DMG_SRC="$(ls -t dist/Helder-*-arm64.dmg 2>/dev/null | head -n1 || true)"
|
|
|
|
[ -d "$APP_SRC" ] || { echo "✗ Build output not found: $APP_SRC"; exit 1; }
|
|
[ -n "$DMG_SRC" ] && [ -f "$DMG_SRC" ] || { echo "✗ No built .dmg found in dist/"; exit 1; }
|
|
|
|
mkdir -p "$APPS_DIR"
|
|
|
|
# Quit a running copy so we can replace the bundle cleanly.
|
|
osascript -e 'tell application "Helder" to quit' >/dev/null 2>&1 || true
|
|
sleep 1
|
|
|
|
echo "▶ Installing app → $APP_DEST"
|
|
rm -rf "$APP_DEST"
|
|
cp -R "$APP_SRC" "$APP_DEST"
|
|
# Unsigned ad-hoc build: clear the quarantine flag so it launches without the
|
|
# Gatekeeper "unidentified developer" prompt.
|
|
xattr -dr com.apple.quarantine "$APP_DEST" 2>/dev/null || true
|
|
|
|
echo "▶ Copying installer → $DMG_DEST"
|
|
cp -f "$DMG_SRC" "$DMG_DEST"
|
|
|
|
echo "✓ Done."
|
|
echo " • Installed: $APP_DEST (launch from Spotlight)"
|
|
echo " • Installer: $DMG_DEST (renamed from $(basename "$DMG_SRC"))"
|