1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-18 05:40:07 +00:00

Merge branch 'next' of github.com:bhilburn/powerlevel9k into next

This commit is contained in:
Ben Hilburn 2017-05-22 21:45:17 -04:00
commit 643e8372db

View file

@ -807,12 +807,12 @@ prompt_detect_virt() {
if [[ "$virt" == "none" ]]; then if [[ "$virt" == "none" ]]; then
if [[ "$(ls -di / | grep -o 2)" != "2" ]]; then if [[ "$(ls -di / | grep -o 2)" != "2" ]]; then
virt="chroot" virt="chroot"
"$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$virt" "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "yellow" "$virt"
else else
; ;
fi fi
else else
"$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$virt" "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "yellow" "$virt"
fi fi
} }
@ -906,13 +906,16 @@ prompt_node_version() {
# Node version from NVM # Node version from NVM
# Only prints the segment if different than the default value # Only prints the segment if different than the default value
prompt_nvm() { prompt_nvm() {
[[ ! $(type nvm) =~ 'nvm is a shell function'* ]] && return local node_version nvm_default
local node_version=$(nvm current) (( $+functions[nvm_version] )) || return
[[ -z "${node_version}" ]] || [[ ${node_version} = "none" ]] && return
local nvm_default=$(cat $NVM_DIR/alias/default) node_version=$(nvm_version current)
[[ -z "${node_version}" || ${node_version} == "none" ]] && return
nvm_default=$(nvm_version default)
[[ "$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" "magenta" "black" "${node_version:1}" 'NODE_ICON'
} }
# NodeEnv Prompt # NodeEnv Prompt