From e3cbffd15be471380c488934edd9b6bff1a14c5b Mon Sep 17 00:00:00 2001 From: Gerard Ribugent Date: Fri, 5 Nov 2021 15:45:11 +0100 Subject: [PATCH 1/2] Keep nvm prefix if defined --- init.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.fish b/init.fish index 9f2b7a2..923fcb5 100644 --- a/init.fish +++ b/init.fish @@ -1,7 +1,7 @@ function init -a path --on-event init_nvm if type -q fenv set -q NVM_DIR; or set -gx NVM_DIR ~/.nvm - set -g nvm_prefix $NVM_DIR + set -q nvm_prefix; or set -g nvm_prefix $NVM_DIR type -q brew; and test -e (brew --prefix)/Cellar/nvm; From 6ffd2000c533a3353edd73763704dbe9d0affd40 Mon Sep 17 00:00:00 2001 From: Gerard Ribugent Date: Fri, 5 Nov 2021 16:01:31 +0100 Subject: [PATCH 2/2] Update readme --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index ff50850..4eb4891 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,15 @@ Refresh your shell and you are good to go! refresh ``` +If you have installed nvm using a package manager you need to specify where is been installed, add the following line to your `~/.config/fish/config.fish` + +```fish +set -g nvm_prefix /path/to/nvm +``` +In this case, you don't need to set the `NVM_DIR` where the node versions will be installed, by default will be `~/.nvm`, but you can customize it if you want. + +**Note** [Brew](https://brew.sh/) users don't have set up it, the plugin auto-detects it and set up the variable accordingly. + # License [MIT][mit] © [Derek Willian Stavis][author] et [al][contributors]