A macOS utility to track home-manager JJ repo status
1#!/bin/bash
2set -euo pipefail
3
4# Build the app and create a proper macOS .app bundle
5# MenuBarExtra requires a bundled application to render in the menu bar.
6
7# Always run from project root
8SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
9PROJECT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
10cd "${PROJECT_DIR}"
11
12APP_NAME="HomeManagerStatus"
13BUILD_DIR=".build/release"
14APP_BUNDLE="${APP_NAME}.app"
15CONTENTS_DIR="${APP_BUNDLE}/Contents"
16MACOS_DIR="${CONTENTS_DIR}/MacOS"
17
18echo "Building release binary..."
19swift build -c release
20
21echo "Creating app bundle..."
22rm -rf "${APP_BUNDLE}"
23mkdir -p "${MACOS_DIR}"
24
25# Copy the binary
26cp "${BUILD_DIR}/${APP_NAME}" "${MACOS_DIR}/${APP_NAME}"
27
28# Copy Info.plist
29cp "${PROJECT_DIR}/Info.plist" "${CONTENTS_DIR}/Info.plist"
30
31echo "Done! App bundle created at: ${APP_BUNDLE}"
32echo ""
33echo "To run: open ${APP_BUNDLE}"
34echo "To install: cp -r ${APP_BUNDLE} /Applications/"