feat: add volta support to node-info function

This commit is contained in:
Adam 2024-12-15 11:28:41 -08:00
parent c257740c53
commit 5291eae55a

View File

@ -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
@ -28,5 +28,3 @@ if [[ "$version" != (none|system) ]]; then
zformat -f version_formatted "$version_format" "v:$version"
node_info[version]="$version_formatted"
fi
# }