-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·52 lines (42 loc) · 1.74 KB
/
install.sh
File metadata and controls
executable file
·52 lines (42 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# mlController — Full Install Script
# Builds, installs to /Applications, and sets up launch-at-login
set -euo pipefail
APP_NAME="mlController"
BUNDLE_ID="com.boinx.mlcontroller"
INSTALL_DIR="/Applications"
LAUNCH_AGENTS="$HOME/Library/LaunchAgents"
PLIST_NAME="$BUNDLE_ID.plist"
echo "╔══════════════════════════════════════╗"
echo "║ mlController Installer ║"
echo "╚══════════════════════════════════════╝"
echo ""
# Check Swift is available
if ! command -v swift &>/dev/null; then
echo "Error: Swift is not installed. Install Xcode or the Swift toolchain."
exit 1
fi
echo "==> Building $APP_NAME..."
make bundle
echo ""
echo "==> Installing to $INSTALL_DIR/$APP_NAME.app..."
rm -rf "$INSTALL_DIR/$APP_NAME.app"
cp -r "$APP_NAME.app" "$INSTALL_DIR/$APP_NAME.app"
echo ""
echo "==> Setting up LaunchAgent (launch at login)..."
mkdir -p "$LAUNCH_AGENTS"
# Unload existing agent if present
launchctl unload -w "$LAUNCH_AGENTS/$PLIST_NAME" 2>/dev/null || true
cp "LaunchAgents/$PLIST_NAME" "$LAUNCH_AGENTS/$PLIST_NAME"
launchctl load -w "$LAUNCH_AGENTS/$PLIST_NAME"
echo ""
echo "╔══════════════════════════════════════╗"
echo "║ Installation Complete! ║"
echo "╚══════════════════════════════════════╝"
echo ""
echo " App: $INSTALL_DIR/$APP_NAME.app"
echo " Launch at login: enabled"
echo " Web dashboard: http://localhost:8990"
echo ""
echo "==> Launching now..."
open "$INSTALL_DIR/$APP_NAME.app"