This repository was archived by the owner on Aug 13, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathinstall-macos.sh
More file actions
executable file
·62 lines (54 loc) · 1.64 KB
/
Copy pathinstall-macos.sh
File metadata and controls
executable file
·62 lines (54 loc) · 1.64 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
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<'EOF'
Usage: ./install-macos.sh [--bar-only] [--no-bar] [...install.sh flags]
Installs the full Alex macOS experience:
1. the alex binary + daemon (delegates to ./install.sh)
2. Alex menu-bar app (macos/, builds + installs to /Applications)
--bar-only only build/install the menu bar app
--no-bar only run install.sh (skip the menu bar app)
everything else is passed through to ./install.sh
(--service, --upgrade, --prefix DIR)
EOF
}
ROOT="$(cd "$(dirname "$0")" && pwd)"
cd "$ROOT"
. "$ROOT/scripts/lib/install-common.sh"
if [ "$(uname)" != "Darwin" ]; then
echo "install-macos.sh is for macOS — use ./install.sh on this platform" >&2
exit 1
fi
BAR_ONLY=0
NO_BAR=0
PASS=()
for arg in "$@"; do
case "$arg" in
--bar-only) BAR_ONLY=1 ;;
--no-bar) NO_BAR=1 ;;
-h|--help) usage; exit 0 ;;
*) PASS+=("$arg") ;;
esac
done
if [ "$BAR_ONLY" = "0" ]; then
./install.sh ${PASS[@]+"${PASS[@]}"}
fi
if [ "$NO_BAR" = "0" ]; then
VERSION="$(awk -F'"' '/^version =/ { print $2; exit }' Cargo.toml)"
if [ -z "$VERSION" ]; then
echo "Could not derive the app version from Cargo.toml" >&2
exit 1
fi
echo "◆ building Alex (menu bar app)…"
(cd macos && VERSION="$VERSION" ./Scripts/package_app.sh)
quit_alex_apps
if [ -w /Applications ]; then
rm -rf /Applications/Alex.app
ditto macos/dist/Alex.app /Applications/Alex.app
else
sudo rm -rf /Applications/Alex.app
sudo ditto macos/dist/Alex.app /Applications/Alex.app
fi
open /Applications/Alex.app
echo "◆ Alex installed to /Applications and launched"
fi