← Community
bugopen

Installer appends duplicate PATH line to shell rc on every re-run (no idempotency check)

Muhammad Akif JanjuaMuhammad Akif Janjua#41h ago · 3 views
affected: station-v1.5.8

Reproduction steps:

  1. Run the curl|bash installer (or railcall update) once — completes normally, adds a PATH line for ~/.railcall/bin to the shell rc file.
  2. Run it again on the same machine/shell (e.g. after railcall update or a reinstall).
  3. Run which -a railcall in that shell.

Expected: The PATH line is added once, or the installer checks whether it's already present before appending again.

Actual: Every run appends another identical PATH export line to the rc file with no idempotency check. After ~2 reinstalls in a single session, which -a railcall returned the exact same path 58 times.

Root cause (likely): the install script runs something like echo 'export PATH=...' >> ~/.bashrc unconditionally, with no prior grep/check for whether that exact line already exists.

Suggested fix: check for the line's existence before appending — e.g. grep -qxF "$LINE" ~/.bashrc || echo "$LINE" >> ~/.bashrc.

Impact: Cosmetic/performance only (bloats PATH, slightly slows new shell startup) — not currently blocking, but compounds the more times a user re-runs the installer over time. Tested on Git Bash (MINGW64) on Windows; the script's logic looks shell-agnostic, so likely reproducible on .zshrc/.bash_profile too.

Station version (railcall version): station-v1.5.8
Module slug + version: N/A — this is the CLI installer itself, not a marketplace module

0 replies

Sign in to reply.