mirror of
https://github.com/jarrodwatts/claude-hud.git
synced 2026-05-20 23:19:58 +00:00
docs: add project documentation and improve robustness
- Add ARCHITECTURE.md, FAQ.md, LLM.md documentation - Add LICENSE (MIT), CODE_OF_CONDUCT.md, PR template - Add .editorconfig for consistent formatting - Add check.sh script for validation - Fix ESLint errors in hud-config.ts and settings-reader.ts - Various test and component improvements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
21
scripts/check.sh
Executable file
21
scripts/check.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
cd "$ROOT_DIR/tui"
|
||||
|
||||
echo "==> Installing dependencies"
|
||||
bun install
|
||||
|
||||
echo "==> Lint"
|
||||
bun run lint
|
||||
|
||||
echo "==> Typecheck"
|
||||
bun run typecheck
|
||||
|
||||
echo "==> Test"
|
||||
bun test
|
||||
|
||||
echo "==> Build"
|
||||
bun run build
|
||||
@@ -16,9 +16,25 @@ fi
|
||||
|
||||
HUD_DIR="$HOME/.claude/hud"
|
||||
EVENT_FIFO="$HUD_DIR/events/$SESSION_ID.fifo"
|
||||
PID_FILE="$HUD_DIR/pids/$SESSION_ID.pid"
|
||||
REFRESH_FILE="$HUD_DIR/refresh.json"
|
||||
|
||||
# Only clean up the FIFO, not the HUD process
|
||||
# HUD persists across sessions for /new and /resume
|
||||
# Only close the HUD if this session is still the active one.
|
||||
# This keeps HUD alive for /new while closing on /exit or terminal close.
|
||||
if [ -f "$REFRESH_FILE" ]; then
|
||||
CURRENT_SESSION=$(jq -r '.sessionId // empty' "$REFRESH_FILE" 2>/dev/null)
|
||||
if [ "$CURRENT_SESSION" = "$SESSION_ID" ]; then
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
PID=$(cat "$PID_FILE" 2>/dev/null)
|
||||
if [ -n "$PID" ] && kill -0 "$PID" 2>/dev/null; then
|
||||
kill "$PID" 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Clean up FIFO and pid file for this session
|
||||
rm -f "$EVENT_FIFO"
|
||||
rm -f "$PID_FILE"
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -26,22 +26,9 @@ REFRESH_FILE="$HUD_DIR/refresh.json"
|
||||
rm -f "$EVENT_FIFO"
|
||||
mkfifo "$EVENT_FIFO"
|
||||
|
||||
if [ ! -d "$PLUGIN_ROOT/tui/node_modules" ]; then
|
||||
cd "$PLUGIN_ROOT/tui"
|
||||
if command -v bun &> /dev/null; then
|
||||
bun install --silent 2>/dev/null || true
|
||||
elif command -v npm &> /dev/null; then
|
||||
npm install --silent 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f "$PLUGIN_ROOT/tui/dist/index.js" ]; then
|
||||
cd "$PLUGIN_ROOT/tui"
|
||||
if command -v bun &> /dev/null; then
|
||||
bun run build 2>/dev/null || true
|
||||
elif command -v npm &> /dev/null; then
|
||||
npm run build 2>/dev/null || true
|
||||
fi
|
||||
echo "claude-hud build missing. Run 'bun install' and 'bun run build' in $PLUGIN_ROOT/tui." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if command -v bun &> /dev/null; then
|
||||
|
||||
Reference in New Issue
Block a user