fix: update Volta version parsing to match current output format

This commit is contained in:
Adam 2024-12-15 11:35:01 -08:00
parent 5291eae55a
commit 9d89a67162

View File

@ -16,7 +16,8 @@ typeset -gA node_info
if (( $+commands[nodenv] )); then if (( $+commands[nodenv] )); then
version="${${$(nodenv version)#v}[(w)0]}" version="${${$(nodenv version)#v}[(w)0]}"
elif (( $+commands[volta] )); then elif (( $+commands[volta] )); then
version="${${$(volta list node | grep 'default')#⚡ }[(w)2]}" # Parse Volta output format: "runtime node@22.12.0 (default)"
version="${${$(volta list node | grep 'default')#*@}%% *}"
elif (( $+functions[nvm_version] )); then elif (( $+functions[nvm_version] )); then
version="${$(nvm_version)#v}" version="${$(nvm_version)#v}"
elif (( $+commands[node] )) ; then elif (( $+commands[node] )) ; then