idempotent install script

This commit is contained in:
Chris Wanstrath 2026-03-04 11:55:16 -08:00
parent f8c5890e07
commit 845479fa91

View File

@ -53,9 +53,7 @@ if [ ! -x "$BUN" ]; then
[ -x "$BUN" ] || fail "bun installation failed."
fi
if [ ! -x /usr/local/bin/bun ]; then
sudo ln -sf "$BUN" /usr/local/bin/bun
fi
sudo setcap 'cap_net_bind_service=+ep' "$BUN"
@ -72,15 +70,17 @@ fi
# ── Directories ──────────────────────────────────────────
mkdir -p "$APPS_DIR" "$DATA_DIR"
mkdir -p "$APPS_DIR" "$DATA_DIR" "$DATA_DIR/toes"
# ── Dependencies & build ─────────────────────────────────
cd "$DEST"
info "Installing dependencies"
cd "$DEST" && quiet bun install
quiet bun install
info "Building"
cd "$DEST" && quiet bun run build
quiet bun run build
# ── Bundled apps ─────────────────────────────────────────
@ -106,7 +106,7 @@ sudo systemctl restart toes
# ── Done ─────────────────────────────────────────────────
VERSION=$(cd "$DEST" && git describe --tags --always 2>/dev/null || echo "unknown")
VERSION=$(git describe --tags --always 2>/dev/null || echo "unknown")
echo ""
echo " toes $VERSION is running!"