mirror of
https://github.com/sorin-ionescu/prezto.git
synced 2025-01-23 11:12:15 +08:00
feat: add volta support to node-info function
This commit is contained in:
parent
c257740c53
commit
5291eae55a
@ -6,8 +6,6 @@
|
||||
# Zeh Rizzatti <zehrizzatti@gmail.com>
|
||||
#
|
||||
|
||||
# function node-info {
|
||||
|
||||
local version
|
||||
local version_format
|
||||
local version_formatted
|
||||
@ -17,6 +15,8 @@ typeset -gA node_info
|
||||
|
||||
if (( $+commands[nodenv] )); then
|
||||
version="${${$(nodenv version)#v}[(w)0]}"
|
||||
elif (( $+commands[volta] )); then
|
||||
version="${${$(volta list node | grep 'default')#⚡ }[(w)2]}"
|
||||
elif (( $+functions[nvm_version] )); then
|
||||
version="${$(nvm_version)#v}"
|
||||
elif (( $+commands[node] )) ; then
|
||||
@ -27,6 +27,4 @@ if [[ "$version" != (none|system) ]]; then
|
||||
zstyle -s ':prezto:module:node:info:version' format 'version_format'
|
||||
zformat -f version_formatted "$version_format" "v:$version"
|
||||
node_info[version]="$version_formatted"
|
||||
fi
|
||||
|
||||
# }
|
||||
fi
|
Loading…
Reference in New Issue
Block a user