Skip to content

fix: prevent false positive in install.sh PATH detection#12

Merged
TimBeyer merged 2 commits intomainfrom
fix/install-path-grep-false-positive
Mar 12, 2026
Merged

fix: prevent false positive in install.sh PATH detection#12
TimBeyer merged 2 commits intomainfrom
fix/install-path-grep-false-positive

Conversation

@TimBeyer
Copy link
Owner

Summary

  • setup_path() in install.sh used grep -qF '.local/bin' to check if ~/.local/bin was already configured in shell rc files. This matched /usr/local/bin as a substring, causing the script to skip the PATH addition on nearly all machines.
  • Narrowed the grep pattern to $HOME/.local/bin, which matches only the line we actually write and won't false-positive on /usr/local/bin.

Test plan

  • All 230 existing unit tests pass
  • Manual verification: /usr/local/bin in rc file no longer triggers a false match
  • Manual verification: $HOME/.local/bin in rc file is still correctly detected

🤖 Generated with Claude Code

TimBeyer and others added 2 commits March 12, 2026 23:48
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The grep pattern `.local/bin` matched `/usr/local/bin` as a substring,
causing setup_path() to skip adding ~/.local/bin to shell rc files on
nearly all machines. Narrow the pattern to `$HOME/.local/bin` which
matches only the line we actually write.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@TimBeyer TimBeyer merged commit c27a8bf into main Mar 12, 2026
4 checks passed
@TimBeyer TimBeyer deleted the fix/install-path-grep-false-positive branch March 12, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant