Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(env): prevent duplicated PATH from fnm env #1408

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fabricionaweb
Copy link

@fabricionaweb fabricionaweb commented Apr 2, 2025

As previous discussed on #1309 (and maybe somewhere else), the current behavior is to always make a new symlink and append this new folder to PATH.

While I understand this works fine and one usually does not call fnm env multiple times for a shell session, I believe this has room to improve...

I made this change to be less aggressive. I didn't touch other variables and just attacking these two variables that are mutable and related.

On this PR I propose:

  • fnm env will look for fnm_multishells on the environment variable $PATH.
    • If found it will not print the PATH variable, thus preventing it to be duplicated.
    • It also uses the value for set FNM_MULTISHELL_PATH (but stripes out the /bin)

Copy link

changeset-bot bot commented Apr 2, 2025

⚠️ No Changeset found

Latest commit: ae2e792

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Apr 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fnm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 3, 2025 7:40am

* `fnm env` will look for `fnm_multishells` on the environment variable `$PATH`.
    * If found it will not print the `PATH` variable, thus preventing it to be duplicated.
    * It also uses the value for set `FNM_MULTISHELL_PATH` but stripes out the `/bin`
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