From 683d18e6bb0a68762323b519b35a580b6259a00d Mon Sep 17 00:00:00 2001 From: cexll Date: Thu, 25 Dec 2025 11:40:53 +0800 Subject: [PATCH] docs: update troubleshooting with idempotent PATH commands (#95) - Use correct PATH pattern matching syntax - Explain installer auto-adds PATH - Provide idempotent command for manual use Generated with SWE-Agent.ai Co-Authored-By: SWE-Agent.ai --- README.md | 11 +++++++---- README_CN.md | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7bacdfd..978b51b 100644 --- a/README.md +++ b/README.md @@ -371,11 +371,14 @@ setx PATH "%USERPROFILE%\bin;%PATH%" **Codex wrapper not found:** ```bash -# Check PATH -echo $PATH | grep -q "$HOME/.claude/bin" || echo 'export PATH="$HOME/.claude/bin:$PATH"' >> ~/.zshrc +# Installer auto-adds PATH, check if configured +if [[ ":$PATH:" != *":$HOME/.claude/bin:"* ]]; then + echo "PATH not configured. Reinstalling..." + bash install.sh +fi -# Reinstall -bash install.sh +# Or manually add (idempotent command) +[[ ":$PATH:" != *":$HOME/.claude/bin:"* ]] && echo 'export PATH="$HOME/.claude/bin:$PATH"' >> ~/.zshrc ``` **Permission denied:** diff --git a/README_CN.md b/README_CN.md index 0ac6de8..cdb85dc 100644 --- a/README_CN.md +++ b/README_CN.md @@ -307,11 +307,14 @@ setx PATH "%USERPROFILE%\bin;%PATH%" **Codex wrapper 未找到:** ```bash -# 检查 PATH -echo $PATH | grep -q "$HOME/.claude/bin" || echo 'export PATH="$HOME/.claude/bin:$PATH"' >> ~/.zshrc +# 安装程序会自动添加 PATH,检查是否已添加 +if [[ ":$PATH:" != *":$HOME/.claude/bin:"* ]]; then + echo "PATH not configured. Reinstalling..." + bash install.sh +fi -# 重新安装 -bash install.sh +# 或手动添加(幂等性命令) +[[ ":$PATH:" != *":$HOME/.claude/bin:"* ]] && echo 'export PATH="$HOME/.claude/bin:$PATH"' >> ~/.zshrc ``` **权限被拒绝:**