Skip to content

Instantly share code, notes, and snippets.

@pateketrueke
Created July 9, 2015 20:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pateketrueke/56efba0051e86567bab0 to your computer and use it in GitHub Desktop.
Save pateketrueke/56efba0051e86567bab0 to your computer and use it in GitHub Desktop.
function nvm
bash -c 'source ~/.nvm/nvm.sh; nvm "$@"' nvm $argv
set -l node_dir "$HOME/.nvm/versions/node"
switch (echo $argv[1])
case install
case use
set -l node_version (ls $node_dir | grep $argv[2])
set -l node_version (echo $node_version | cut -d " " -f1)
set -U fish_user_paths "$node_dir/$node_version/bin"
end
end
@nfriedly
Copy link

Thanks, this is almost just what I needed (I had to change node_dir to just $HOME/.nvm, and then it worked perfectly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment