[MINOR] install.sh PATH configuration not idempotent #33

Open
opened 2026-05-11 10:52:02 +00:00 by thabeta · 1 comment
Owner

Problem

The PATH check in install.sh uses grep -q "hero/bin". This can:

  1. False-match on a different PATH entry containing "hero/bin" as a substring
  2. Append duplicate PATH lines if the user's shellrc already has a similar but differently-formatted line
  3. Create ~/.profile even when the user uses bash/zsh, potentially conflicting with existing config

Impact

Duplicate PATH entries, shell configuration pollution.

Files

  • scripts/install.sh -- configure_path function

Suggested Fix

  • Use exact string matching instead of grep substring
  • Check $PATH at runtime instead of modifying shellrc
  • Use pathman or similar for proper PATH management
## Problem The PATH check in `install.sh` uses `grep -q "hero/bin"`. This can: 1. False-match on a different PATH entry containing "hero/bin" as a substring 2. Append duplicate PATH lines if the user's shellrc already has a similar but differently-formatted line 3. Create `~/.profile` even when the user uses bash/zsh, potentially conflicting with existing config ## Impact Duplicate PATH entries, shell configuration pollution. ## Files - `scripts/install.sh` -- `configure_path` function ## Suggested Fix - Use exact string matching instead of grep substring - Check `$PATH` at runtime instead of modifying shellrc - Use `pathman` or similar for proper PATH management
Member

Classification: valid-bug — install.sh PATH configuration uses grep substring match, can false-match and create duplicate PATH entries.

grep -q "hero/bin" catches substrings; may append duplicate PATH lines; creates ~/.profile even for bash/zsh users.

> Classification: valid-bug — install.sh PATH configuration uses grep substring match, can false-match and create duplicate PATH entries. grep -q "hero/bin" catches substrings; may append duplicate PATH lines; creates ~/.profile even for bash/zsh users.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_code/my_init#33
No description provided.