# # Exposes information about the Node.js environment via the $node_info # associative array. # # Authors: # Zeh Rizzatti # Robbie Trencheny # local version local version_format local version_formatted unset node_info typeset -gA node_info if (( $+functions[nvm_version] )); then version="${$(nvm_version)#iojs-#v}" if nvm_is_iojs_version "$(nvm_version)"; then fork="$(nvm_iojs_prefix)" else fork="$(nvm_node_prefix)" fi fi if [[ "$version" != (none|) ]]; then zstyle -s ':prezto:module:node:info:version' format 'version_format' zformat -f version_formatted "$version_format" "v:$version" zstyle -s ':prezto:module:node:info:fork' format 'fork_format' zformat -f fork_formatted "$fork_format" "f:$fork" node_info[version]="$version_formatted" node_info[fork]="$fork_formatted" fi