Files
iKeyMon/scripts/serve_local_appcast.sh
2025-12-08 19:30:12 +01:00

26 lines
909 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Generate a local appcast and serve it over HTTP for Sparkle testing without
# publishing a new release. Sparkle disallows file:// feeds, so we use
# http://localhost:${PORT}/appcast-local.xml.
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PORT="${PORT:-8000}"
WORKDIR="$(mktemp -d)"
trap 'rm -rf "$WORKDIR"' EXIT
"$ROOT_DIR/scripts/make_local_appcast.sh" "${1:-$ROOT_DIR/Sparkle/appcast.xml}" "$WORKDIR/appcast-local.xml"
echo "🍏 Serving local appcast on http://127.0.0.1:${PORT}/appcast-local.xml"
echo "Set SUFeedURL to that URL, then launch iKeyMon and check for updates."
echo
echo "To set it:"
echo " defaults write net.24unix.iKeyMon SUFeedURL \"http://127.0.0.1:${PORT}/appcast-local.xml\""
echo " killall iKeyMon 2>/dev/null; open /Applications/iKeyMon.app"
echo
echo "Press Ctrl+C to stop."
cd "$WORKDIR"
python3 -m http.server "$PORT"