jorgebucaran / nvm.fish

The Node.js version manager you'll adore, crafted just for Fish
https://git.io/nvm.fish
MIT License
2.06k stars 69 forks source link

Added function to symlink existing packages to nvm.fish #193

Closed horlarme closed 1 year ago

horlarme commented 2 years ago

This request adds another step to the installation of the plugin by checking for existing Node Release (if available) and creating a symlink from them to the nvm.fish package directory.

This is mainly useful when an existing NVM installation exists on the previous shell before fish is installed.

There is a function available _nvm_symlink_local which can also be used on request.

jorgebucaran commented 2 years ago

Is this compatible with normal nvm.fish usage?

horlarme commented 2 years ago

What do you mean by normal nvm.fish?

jorgebucaran commented 2 years ago

Does this support Tab-completions, nvm install, ls, use, and uninstall?

horlarme commented 2 years ago

I don't think I really understand the question still but at same time, no, it doesn't support listing (ls) the existing releases (if this is what you meant). It is meant to only run at installation (although could be used after installation by calling its name).

jorgebucaran commented 2 years ago

Well, do tab completions for nvm use, ls, etc., work as usual after symlinks are created for previously downloaded Node versions via POSIX nvm? I don't know how POSIX nvm installs Node versions exactly, so I'm surprised this actually works.

horlarme commented 2 years ago

Oh... Yes. Running nvm list lists the existing releases as part of the list and other actions can be done on it like nvm use, although I haven't tried remove... Will update on this. Or do you think it should have been a copy instead of symlink?

horlarme commented 2 years ago

I have confirmed that every other command associated with nvm.fish works with the symlinked releases.

jorgebucaran commented 2 years ago

Cool! Does that include Tab-completions for all commands? For example, if Node 15 is installed, nvm uninstall should be able to auto complete that version for you.

horlarme commented 2 years ago

Sorry for replying late, yesterday was my mother's birthday and today, I celebrated my daughters naming so I haven't really used my PC since.

Yes, there is tab completion for changing (use) a release as seen in the screenshot below image

jorgebucaran commented 1 year ago

Thank you for taking the time to create this PR. While I appreciate the effort put into this feature, I don't think it's necessary to add it to nvm.fish at this time. Perhaps we can revisit this in the future if we hear from more users or the issue becomes more clearly defined. Thanks again for your contribution!