fix: プラグインインストール時の claude コマンド PATH 解決を改善 - #634
Conversation
- PATH フォールバックのディレクトリ存在チェックを削除し、常に追加 - claude コマンドが見つからない場合に find で探索して PATH に追加 - root ユーザーで実行される Docker ビルド時に PATH が通らない問題を修正 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe script now unconditionally prepends Claude binary directories to PATH and implements smarter binary detection logic. It checks if Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0915f67fda
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| log_warn "claude コマンドが PATH に見つかりません" | ||
| log_info "PATH: $PATH" | ||
| # which で探索してパスを特定 | ||
| CLAUDE_BIN=$(find /home/vscode/.claude/local/bin /usr/local/bin -name claude -type f 2>/dev/null | head -1) |
There was a problem hiding this comment.
Handle missing dirs in claude binary discovery
With set -euo pipefail, the command substitution CLAUDE_BIN=$(find ... | head -1) aborts the script when any search root is missing (for example /home/vscode/.claude/local/bin before Claude is installed), because find returns non-zero and pipefail propagates it. That means execution can stop before the if [[ -n "$CLAUDE_BIN" ]] check, so the new fallback path fails in the exact environment it was meant to recover.
Useful? React with 👍 / 👎.
| export PATH="${CLAUDE_BIN_DIR}:${PATH}" | ||
| else | ||
| log_warn "claude バイナリが見つかりません。プラグインインストールをスキップします。" | ||
| exit 0 |
There was a problem hiding this comment.
Remove credentials before early successful exit
The new exit 0 branch returns before the final cleanup step, but credentials have already been written to ${CLAUDE_DIR}/.credentials.json earlier in the script. If claude is not found, the build now succeeds while leaving auth material on disk, which can bake secrets into the resulting image.
Useful? React with 👍 / 👎.
コードレビュー概要
良い点
指摘事項[minor]
|
|
🎉 This PR is included in version 1.106.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
install-claude-plugins.shでclaudeコマンドが見つからない問題を修正Why
Dockerfile の
ENV PATHは設定されているが、--mount=type=secretを使う RUN ステップで PATH が正しく引き継がれないケースがあり、claude: command not foundでプラグインインストールが 15 件すべて失敗していた。What
-d(ディレクトリ存在) チェックを削除し、常に PATH に追加claudeコマンドが見つからない場合、findで探索して PATH に追加するフォールバックを追加Test plan
docker-image.ymlビルドでプラグインが正常にインストールされることClaude version: x.x.xが表示されること🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Bug Fixes
Chores