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

Combine two checks into one

This commit is contained in:
Sudarshan Wadkar 2016-03-16 17:25:39 -04:00
parent f7b7ff21c9
commit 7fcac16c5f

View file

@ -560,9 +560,8 @@ prompt_node_version() {
prompt_nvm() { prompt_nvm() {
[[ ! $(type nvm) =~ 'nvm is a shell function'* ]] && return [[ ! $(type nvm) =~ 'nvm is a shell function'* ]] && return
local node_version=$(nvm current) local node_version=$(nvm current)
[[ ${node_version} = "none" ]] && return [[ -z "${node_version}" ]] || [[ ${node_version} = "none" ]] && return
local nvm_default=$(cat $NVM_DIR/alias/default) local nvm_default=$(cat $NVM_DIR/alias/default)
[[ -z "${node_version}" ]] && return
[[ "$node_version" =~ "$nvm_default" ]] && return [[ "$node_version" =~ "$nvm_default" ]] && return
$1_prompt_segment "$0" "$2" "green" "011" "${node_version:1}" 'NODE_ICON' $1_prompt_segment "$0" "$2" "green" "011" "${node_version:1}" 'NODE_ICON'