1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-16 17:50:09 +00:00

Fix NVM prompt to return if not used

This commit changes nvm prompt setup to return immediately if no node
version is installed/available.
Currently, prompt complains for lack of global node version.
Specifically, if you install nvm (from brew or manually) and do not have
global node installed (or set), then the prompt should not set or show
anything. This commit ensures this by immediately returning if
`nvm current` returns "none".
This commit is contained in:
Sudarshan Wadkar 2016-03-14 20:57:30 -04:00
parent 88fd11a865
commit f7b7ff21c9

View file

@ -560,6 +560,7 @@ prompt_node_version() {
prompt_nvm() {
[[ ! $(type nvm) =~ 'nvm is a shell function'* ]] && return
local node_version=$(nvm current)
[[ ${node_version} = "none" ]] && return
local nvm_default=$(cat $NVM_DIR/alias/default)
[[ -z "${node_version}" ]] && return
[[ "$node_version" =~ "$nvm_default" ]] && return