-
Notifications
You must be signed in to change notification settings - Fork 526
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
Prevent duplicate fnm_multishells in PATH #1309
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Only eval `fnm env` in non-login shells.
please explain this change further |
none of my scripts actually run |
The reason is that it's standard to source If we don't have this check, it'll lead to duplicate |
One possible alternative is to add a check to |
this sounds better. filtering out other multishell paths sounds like the best way to do that. |
Im playing around here, although I dont know Rust I was able to read from The bad take on this is that it returns the full Example: before $ fnm env --shell bash
export PATH="/run/user/1000/fnm_multishells/5255_1743507809600/bin":"$PATH"
export FNM_MULTISHELL_PATH="/run/user/1000/fnm_multishells/5255_1743507809600"
export FNM_VERSION_FILE_STRATEGY="local"
export FNM_DIR="/home/fabricio/.local/share/fnm"
export FNM_LOGLEVEL="info"
export FNM_NODE_DIST_MIRROR="https://nodejs.org/dist"
export FNM_COREPACK_ENABLED="false"
export FNM_RESOLVE_ENGINES="true"
export FNM_ARCH="x64" after $ ./target/debug/fnm env --shell bash
export PATH="/run/user/1000/fnm_multishells/7193_1743508011184/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/home/fabricio/.local/bin:/home/fabricio/.asdf/shims:/home/fabricio/.asdf/installs/golang/1.23.3/packages/bin"
export FNM_MULTISHELL_PATH="/run/user/1000/fnm_multishells/7193_1743508011184"
export FNM_VERSION_FILE_STRATEGY="local"
export FNM_DIR="/home/fabricio/.local/share/fnm"
export FNM_LOGLEVEL="info"
export FNM_NODE_DIST_MIRROR="https://nodejs.org/dist"
export FNM_COREPACK_ENABLED="false"
export FNM_RESOLVE_ENGINES="true"
export FNM_ARCH="x64" and filtering it (note the echo $PATH
/run/user/1000/fnm_multishells/6993_1743507996360/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/home/fabricio/.local/bin:/home/fabricio/.asdf/shims:/home/fabricio/.asdf/installs/golang/1.23.3/packages/bin
$ ./target/debug/fnm env --shell bash
export PATH="/run/user/1000/fnm_multishells/8013_1743508192319/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/home/fabricio/.local/bin:/home/fabricio/.asdf/shims:/home/fabricio/.asdf/installs/golang/1.23.3/packages/bin"
export FNM_MULTISHELL_PATH="/run/user/1000/fnm_multishells/8013_1743508192319"
export FNM_VERSION_FILE_STRATEGY="local"
export FNM_DIR="/home/fabricio/.local/share/fnm"
export FNM_LOGLEVEL="info"
export FNM_NODE_DIST_MIRROR="https://nodejs.org/dist"
export FNM_COREPACK_ENABLED="false"
export FNM_RESOLVE_ENGINES="true"
export FNM_ARCH="x64" Would this approach be any good @Schniz ? I can send MR/patch of changes if you agree on the idea. Honest, I think this is simplier... I will add an if before load the
|
@fabricionaweb We could just make It could be understood as: "The env is already correct, we have nothing to set." |
To return nothing, IMO seems too much, the I made the PR where I only touch on I hope that helps |
Then I believe it just brings us full circle. The whole problem was that I only proposed the workaround of not setting anything in But if things can change, then it gets more complicated... I think we need to replace the old |
That is good point! And I dont know the answer 😅 But from what I've seen, the multishell_path does not need to change because of those flags. It is just like runtime things that reads on I need to wait for Schniz and what he thinks. To not return nothing it is easy and much simple than what I have done. And it could also have a |
Only eval
fnm env
in non-login shells.The duplicate fnm_multishells in PATH leads to many problems, including a very broken
fnm use system
.(This will of course also need to be fixed in the installer script as well...)