nvm.fish icon indicating copy to clipboard operation
nvm.fish copied to clipboard

Added function to symlink existing packages to nvm.fish

Open horlarme opened this issue 3 years ago • 9 comments

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.

horlarme avatar Aug 06 '22 10:08 horlarme

Is this compatible with normal nvm.fish usage?

jorgebucaran avatar Aug 09 '22 01:08 jorgebucaran

What do you mean by normal nvm.fish?

horlarme avatar Aug 09 '22 06:08 horlarme

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

jorgebucaran avatar Aug 09 '22 19:08 jorgebucaran

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).

horlarme avatar Aug 09 '22 19:08 horlarme

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.

jorgebucaran avatar Aug 09 '22 21:08 jorgebucaran

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 avatar Aug 09 '22 21:08 horlarme

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

horlarme avatar Aug 10 '22 07:08 horlarme

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.

jorgebucaran avatar Aug 10 '22 11:08 jorgebucaran

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

horlarme avatar Aug 11 '22 20:08 horlarme

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!

jorgebucaran avatar Apr 30 '23 06:04 jorgebucaran