diff --git a/.claude/scripts/sync.sh b/.claude/scripts/sync.sh index 4bb655f..6b45792 100755 --- a/.claude/scripts/sync.sh +++ b/.claude/scripts/sync.sh @@ -37,12 +37,22 @@ fi echo -e "${GREEN}[OK]${NC} Working directory: $(pwd)" +# Detect Python interpreter (python3 on Mac/Linux, python on Windows) +if command -v python3 >/dev/null 2>&1; then + PYTHON=python3 +elif command -v python >/dev/null 2>&1; then + PYTHON=python +else + echo -e "${RED}[ERROR]${NC} No Python interpreter found (need python or python3)" + exit 1 +fi + # Load user identity USER_DISPLAY="unknown" USER_GITEA="" if [ -f ".claude/identity.json" ]; then - USER_DISPLAY=$(python -c "import json,sys; d=json.load(open('.claude/identity.json')); print(d.get('full_name', d.get('user','unknown')))" 2>/dev/null || echo "unknown") - USER_GITEA=$(python -c "import json,sys; d=json.load(open('.claude/identity.json')); print(d.get('user',''))" 2>/dev/null || echo "") + USER_DISPLAY=$($PYTHON -c "import json,sys; d=json.load(open('.claude/identity.json')); print(d.get('full_name', d.get('user','unknown')))" 2>/dev/null || echo "unknown") + USER_GITEA=$($PYTHON -c "import json,sys; d=json.load(open('.claude/identity.json')); print(d.get('user',''))" 2>/dev/null || echo "") fi echo -e "${GREEN}[OK]${NC} Syncing as: $USER_DISPLAY (machine: $MACHINE)"