Skip to content

fix(install): Warn when another flagsmith on PATH may shadow the install - #97

Merged
khvn26 merged 4 commits into
mainfrom
fix/install-warn-conflicting-cli
Aug 20, 2026
Merged

fix(install): Warn when another flagsmith on PATH may shadow the install#97
khvn26 merged 4 commits into
mainfrom
fix/install-warn-conflicting-cli

Conversation

@khvn26

@khvn26 khvn26 commented Aug 19, 2026

Copy link
Copy Markdown
Member

Closes #75.

In this PR, we add the following installer script improvements:

  • The installer detects existing flagsmith command, walks the PATH to identify each conflicting binary, and lists them with a warning.
  • Reinstalling over existing ${INSTALL_DIR}/flagsmith produces no warning, and the final message now distinguishes the two cases: installed <version> to <path> on first install, updated <version> at <path> when overwriting.

Fresh install with an old CLI still on PATH:

$ curl -fsSL https://get.flagsmith.com | sh
downloading flagsmith v2.0.0 (darwin/arm64)
installed flagsmith version 2.0.0 to /Users/alice/.local/bin/flagsmith
warning: another 'flagsmith' is on your PATH at /usr/local/bin/flagsmith
It may shadow /Users/alice/.local/bin/flagsmith — uninstall it first ('npm uninstall -g flagsmith-cli' removes the old npm CLI), then run 'hash -r' or open a new shell.

Run 'flagsmith init' to get started.

Re-running the installer over an existing v2 binary (the smooth update path — no warning):

$ curl -fsSL https://get.flagsmith.com | sh
downloading flagsmith v2.0.0 (darwin/arm64)
updated flagsmith version 2.0.0 at /Users/alice/.local/bin/flagsmith

Run 'flagsmith init' to get started.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@khvn26, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fe3c9791-63b3-4c35-afec-78c27e49f0a0

📥 Commits

Reviewing files that changed from the base of the PR and between fc3300a and 1a183d8.

📒 Files selected for processing (2)
  • install.ps1
  • install.sh
📝 Walkthrough

Walkthrough

The shell and PowerShell installers now distinguish between new and existing installations. They report the installed version and executable location. They detect other flagsmith executables on PATH and display conflict warnings. The shell installer compares executable paths before reporting conflicts. Both installers perform conflict reporting after installation verification.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🟡 Moderate · up to fc330

The installer’s new shadowing warnings can be incorrect on Windows and incomplete on Unix-like systems, either flagging non-executable commands or missing a conflicting binary in the current directory. These bounded correctness issues should be fixed before merge.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c752a04c-79cb-43c8-bd1f-4a0e95280bbe

📥 Commits

Reviewing files that changed from the base of the PR and between c0a5cec and fc3300a.

📒 Files selected for processing (2)
  • install.ps1
  • install.sh

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread install.ps1 Outdated
Comment thread install.sh

@matthewelwell matthewelwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vibe-approving based on CodeRabbit's approval, and the low blast radius.

@khvn26
khvn26 merged commit 9ad9979 into main Aug 20, 2026
8 checks passed
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.

install.sh ignores pre-existing flagsmith in PATH

2 participants