fish: bump nvm.fish to 2.2.13
This commit is contained in:
parent
aad67c43a8
commit
3cba2df644
@ -4,15 +4,15 @@ complete --command nvm --exclusive --long help --description "Print help"
|
|||||||
complete --command nvm --long silent --description "Suppress standard output"
|
complete --command nvm --long silent --description "Suppress standard output"
|
||||||
|
|
||||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version"
|
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version"
|
||||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate a version in the current shell"
|
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate the specified Node version in the current shell"
|
||||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed versions"
|
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed Node versions"
|
||||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List versions available to install matching optional regex"
|
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List available Node versions to install"
|
||||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active version"
|
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active Node version"
|
||||||
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "(
|
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "(
|
||||||
test -e $nvm_data && string split ' ' <$nvm_data/.index
|
test -e $nvm_data && string split ' ' <$nvm_data/.index
|
||||||
)"
|
)"
|
||||||
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')"
|
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')"
|
||||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall a version"
|
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall the specified Node version"
|
||||||
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "(
|
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "(
|
||||||
_nvm_list | string split ' ' | string replace system ''
|
_nvm_list | string split ' ' | string replace system ''
|
||||||
)"
|
)"
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
function _nvm_install --on-event nvm_install
|
set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist
|
||||||
set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist
|
|
||||||
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
|
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
|
||||||
set --universal nvm_data $XDG_DATA_HOME/nvm
|
set --global nvm_data $XDG_DATA_HOME/nvm
|
||||||
|
|
||||||
|
function _nvm_install --on-event nvm_install
|
||||||
test ! -d $nvm_data && command mkdir -p $nvm_data
|
test ! -d $nvm_data && command mkdir -p $nvm_data
|
||||||
echo "Downloading the Node distribution index..." 2>/dev/null
|
echo "Downloading the Node distribution index..." 2>/dev/null
|
||||||
_nvm_index_update
|
_nvm_index_update
|
||||||
end
|
end
|
||||||
|
|
||||||
function _nvm_update --on-event nvm_update
|
function _nvm_update --on-event nvm_update
|
||||||
set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist
|
set --query --universal nvm_data && set --erase --universal nvm_data
|
||||||
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
|
set --query --universal nvm_mirror && set --erase --universal nvm_mirror
|
||||||
set --universal nvm_data $XDG_DATA_HOME/nvm
|
set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist
|
||||||
end
|
end
|
||||||
|
|
||||||
function _nvm_uninstall --on-event nvm_uninstall
|
function _nvm_uninstall --on-event nvm_uninstall
|
||||||
|
@ -29,26 +29,31 @@ function nvm --description "Node version manager"
|
|||||||
|
|
||||||
switch "$cmd"
|
switch "$cmd"
|
||||||
case -v --version
|
case -v --version
|
||||||
echo "nvm, version 2.2.11"
|
echo "nvm, version 2.2.13"
|
||||||
case "" -h --help
|
case "" -h --help
|
||||||
echo "Usage: nvm install <version> Download and activate the specified Node version"
|
echo "Usage: nvm install <version> Download and activate the specified Node version"
|
||||||
echo " nvm install Install version from nearest .nvmrc file"
|
echo " nvm install Install the version specified in the nearest .nvmrc file"
|
||||||
echo " nvm use <version> Activate a version in the current shell"
|
echo " nvm use <version> Activate the specified Node version in the current shell"
|
||||||
echo " nvm use Activate version from nearest .nvmrc file"
|
echo " nvm use Activate the version specified in the nearest .nvmrc file"
|
||||||
echo " nvm list List installed versions"
|
echo " nvm list List installed Node versions"
|
||||||
echo " nvm list-remote List versions available to install"
|
echo " nvm list-remote List available Node versions to install"
|
||||||
echo " nvm list-remote <regex> List versions matching a given regular expression"
|
echo " nvm list-remote <regex> List Node versions matching a given regex pattern"
|
||||||
echo " nvm current Print the currently-active version"
|
echo " nvm current Print the currently-active Node version"
|
||||||
echo " nvm uninstall <version> Uninstall a version"
|
echo " nvm uninstall <version> Uninstall the specified Node version"
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " -s or --silent Suppress standard output"
|
echo " -s, --silent Suppress standard output"
|
||||||
echo " -v or --version Print version"
|
echo " -v, --version Print the version of nvm"
|
||||||
echo " -h or --help Print this help message"
|
echo " -h, --help Print this help message"
|
||||||
echo "Variables:"
|
echo "Variables:"
|
||||||
echo " nvm_arch Override architecture, e.g. x64-musl"
|
echo " nvm_arch Override architecture, e.g. x64-musl"
|
||||||
echo " nvm_mirror Use a mirror of the Node binaries"
|
echo " nvm_mirror Use a mirror for downloading Node binaries"
|
||||||
echo " nvm_default_version Set the default version for new shells"
|
echo " nvm_default_version Set the default version for new shells"
|
||||||
echo " nvm_default_packages Install a list of packages every time you install a Node version"
|
echo " nvm_default_packages Install a list of packages every time a Node version is installed"
|
||||||
|
echo "Examples:"
|
||||||
|
echo " nvm install latest Install the latest version of Node"
|
||||||
|
echo " nvm use 14.15.1 Use Node version 14.15.1"
|
||||||
|
echo " nvm use system Activate the system's Node version"
|
||||||
|
|
||||||
case install
|
case install
|
||||||
_nvm_index_update
|
_nvm_index_update
|
||||||
|
|
||||||
@ -195,8 +200,7 @@ end
|
|||||||
function _nvm_version_match --argument-names ver
|
function _nvm_version_match --argument-names ver
|
||||||
string replace --regex -- '^v?(\d+|\d+\.\d+)$' 'v$1.' $ver |
|
string replace --regex -- '^v?(\d+|\d+\.\d+)$' 'v$1.' $ver |
|
||||||
string replace --filter --regex -- '^v?(\d+)' 'v$1' |
|
string replace --filter --regex -- '^v?(\d+)' 'v$1' |
|
||||||
string escape --style=regex ||
|
string escape --style=regex || string lower '\b'$ver'(?:/\w+)?$'
|
||||||
string lower '\b'$ver'(?:/\w+)?$'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function _nvm_list_format --argument-names current regex
|
function _nvm_list_format --argument-names current regex
|
||||||
@ -225,6 +229,6 @@ function _nvm_node_info
|
|||||||
command node --eval "
|
command node --eval "
|
||||||
console.log(process.version)
|
console.log(process.version)
|
||||||
console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version)
|
console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version)
|
||||||
console.log(process.execPath.replace(require('os').homedir(), '~'))
|
console.log(process.execPath)
|
||||||
"
|
" | string replace -- ~ \~
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user