-
-
Save s4w3d0ff/ba7fe172dcdc58be0fb96cc762572dcf to your computer and use it in GitHub Desktop.
FiSH function/alias for nvm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function nvm | |
bash -c 'source ~/.nvm/nvm.sh; nvm "$@"' nvm $argv | |
set -l node_dir "$HOME/.nvm" | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment