Issue #34 made the hooks honor CLAUDE_CONFIG_DIR when writing the mode flag ($CLAUDE_CONFIG_DIR/.ponytail-active), enforced by tests/hooks.test.js. But both statusline scripts still hardcoded $HOME/.claude/.ponytail-active, so any user with CLAUDE_CONFIG_DIR set gets no badge — or a stale mode from a pre-migration ~/.claude flag that never updates again. Make both scripts resolve the flag the same way getClaudeDir() does: prefer CLAUDE_CONFIG_DIR, fall back to ~/.claude. The fallback branch is identical to the previous behavior, so unset-env users are unaffected. Also corrects the now-inaccurate path comment in the activation hook header.
13 lines
448 B
Bash
13 lines
448 B
Bash
#!/usr/bin/env bash
|
|
# CLAUDE_CONFIG_DIR overrides ~/.claude, matching where the hooks write the flag (issue #34)
|
|
flag="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/.ponytail-active"
|
|
[ -f "$flag" ] || exit 0
|
|
|
|
mode=$(head -n1 "$flag" | tr -d '[:space:]')
|
|
|
|
if [ -z "$mode" ] || [ "$mode" = "full" ]; then
|
|
printf '\033[38;5;108m[PONYTAIL]\033[0m'
|
|
else
|
|
printf '\033[38;5;108m[PONYTAIL:%s]\033[0m' "$(printf '%s' "$mode" | tr '[:lower:]' '[:upper:]')"
|
|
fi
|