fix: add Antigravity prereq check to all setup scripts (#7)
All three setup scripts (Linux, macOS, Windows) now verify that the Antigravity app is installed and the LS binary exists before proceeding. Fails early with a clear error message and suggestions instead of a cryptic runtime crash. Closes #5
This commit is contained in:
@@ -18,7 +18,26 @@ if [ ${#MISSING[@]} -gt 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ── 1. System user for UID isolation ──
|
||||
# ── 1. Prerequisite check: Antigravity must be installed ──
|
||||
LS_BINARY="${ZEROGRAVITY_LS_PATH:-/usr/share/antigravity/resources/app/extensions/antigravity/bin/language_server_linux_x64}"
|
||||
echo "→ Checking for Antigravity installation…"
|
||||
if [ ! -f "$LS_BINARY" ]; then
|
||||
echo ""
|
||||
echo "✗ Antigravity is not installed (or the LS binary is missing)."
|
||||
echo " ZeroGravity requires a working Antigravity installation."
|
||||
echo " The Language Server binary is bundled with the Antigravity app"
|
||||
echo " and cannot be downloaded separately."
|
||||
echo ""
|
||||
echo " Expected path:"
|
||||
echo " $LS_BINARY"
|
||||
echo ""
|
||||
echo " Install Antigravity first, then re-run this script."
|
||||
echo " Alternatively, set ZEROGRAVITY_LS_PATH to a custom LS binary location."
|
||||
exit 1
|
||||
fi
|
||||
echo " Found: $LS_BINARY"
|
||||
|
||||
# ── 2. System user for UID isolation ──
|
||||
echo "→ Creating zerogravity-ls system user…"
|
||||
if id -u zerogravity-ls &>/dev/null; then
|
||||
echo " Already exists."
|
||||
@@ -27,7 +46,7 @@ else
|
||||
echo " Created."
|
||||
fi
|
||||
|
||||
# ── 2. Sudoers rule (run commands as zerogravity-ls without password) ──
|
||||
# ── 3. Sudoers rule (run commands as zerogravity-ls without password) ──
|
||||
SUDOERS="/etc/sudoers.d/zerogravity"
|
||||
echo "→ Installing sudoers rule…"
|
||||
if [ -f "$SUDOERS" ]; then
|
||||
@@ -38,16 +57,16 @@ else
|
||||
echo " Installed: $SUDOERS"
|
||||
fi
|
||||
|
||||
# ── 3. Data directory permissions ──
|
||||
# ── 4. Data directory permissions ──
|
||||
echo "→ Setting up /tmp/zerogravity-standalone…"
|
||||
sudo mkdir -p /tmp/zerogravity-standalone
|
||||
sudo chmod 1777 /tmp/zerogravity-standalone
|
||||
|
||||
# ── 4. Config directory ──
|
||||
# ── 5. Config directory ──
|
||||
echo "→ Setting up ~/.config/zerogravity…"
|
||||
mkdir -p "$HOME/.config/zerogravity"
|
||||
|
||||
# ── 5. Systemd user service ──
|
||||
# ── 6. Systemd user service ──
|
||||
echo "→ Installing systemd user service…"
|
||||
UNIT_DIR="$HOME/.config/systemd/user"
|
||||
mkdir -p "$UNIT_DIR"
|
||||
@@ -73,7 +92,7 @@ systemctl --user daemon-reload
|
||||
echo " Installed: $UNIT_DIR/zerogravity.service"
|
||||
echo " Enable with: systemctl --user enable zerogravity"
|
||||
|
||||
# ── 6. Build ──
|
||||
# ── 7. Build ──
|
||||
echo "→ Building release binary…"
|
||||
cd "$PROJECT_DIR"
|
||||
cargo build --release 2>&1 | tail -1
|
||||
|
||||
Reference in New Issue
Block a user