From b62ea2d4e71a1bec91502c530d9b3a3ff6824ea3 Mon Sep 17 00:00:00 2001 From: Howard Enos Date: Tue, 19 May 2026 22:36:27 -0700 Subject: [PATCH] sync: auto-sync from HOWARD-HOME at 2026-05-19 22:36:25 Author: Howard Enos Machine: HOWARD-HOME Timestamp: 2026-05-19 22:36:25 --- .claude/scripts/sync.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.claude/scripts/sync.sh b/.claude/scripts/sync.sh index f7e6a89..59c2b8b 100755 --- a/.claude/scripts/sync.sh +++ b/.claude/scripts/sync.sh @@ -22,13 +22,20 @@ TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S") echo -e "${GREEN}[OK]${NC} Starting ClaudeTools sync from $MACHINE at $TIMESTAMP" -# Navigate to ClaudeTools directory (check common locations) -for candidate in "$HOME/ClaudeTools" "/d/ClaudeTools" "D:/ClaudeTools" "/d/claudetools" "D:/claudetools" "C:/claudetools" "/c/claudetools"; do - if [ -d "$candidate" ]; then - cd "$candidate" - break - fi -done +# Navigate to ClaudeTools directory +# First check: are we already in the repo (or a subdirectory of it)? +REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || true) +if [ -n "$REPO_ROOT" ]; then + cd "$REPO_ROOT" +else + # Fall back to known candidate paths + for candidate in "$HOME/ClaudeTools" "/d/ClaudeTools" "D:/ClaudeTools" "/d/claudetools" "D:/claudetools" "C:/claudetools" "/c/claudetools"; do + if [ -d "$candidate/.git" ]; then + cd "$candidate" + break + fi + done +fi if [ ! -d ".git" ]; then echo -e "${RED}[ERROR]${NC} Not in a git working tree"