1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
prezto/modules/node/functions/node-info

34 lines
858 B

#
# Exposes information about the Node.js environment via the $node_info
# associative array.
#
# Authors:
# Zeh Rizzatti <zehrizzatti@gmail.com>
# Robbie Trencheny <me@robbiet.us>
#
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