mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-18 05:40:07 +00:00
Merge pull request #156 from dritter/node_cleanup
Cleaning up the `node` segment.
This commit is contained in:
commit
91e9fb865c
1 changed files with 5 additions and 6 deletions
|
@ -395,11 +395,10 @@ prompt_load() {
|
||||||
|
|
||||||
# Node version
|
# Node version
|
||||||
prompt_node_version() {
|
prompt_node_version() {
|
||||||
local nvm_prompt
|
local node_version=$(node -v 2>/dev/null)
|
||||||
nvm_prompt=$(node -v 2>/dev/null)
|
[[ -z "${node_version}" ]] && return
|
||||||
[[ -z "${nvm_prompt}" ]] && return
|
|
||||||
|
|
||||||
"$1_prompt_segment" "$0" "green" "white" "${nvm_prompt:1} $(print_icon 'NODE_ICON')"
|
"$1_prompt_segment" "$0" "green" "white" "${node_version:1} $(print_icon 'NODE_ICON')"
|
||||||
}
|
}
|
||||||
|
|
||||||
# print a little OS icon
|
# print a little OS icon
|
||||||
|
@ -468,8 +467,8 @@ prompt_nvm() {
|
||||||
local nvm_default=$(cat $NVM_DIR/alias/default)
|
local nvm_default=$(cat $NVM_DIR/alias/default)
|
||||||
[[ -z "${node_version}" ]] && return
|
[[ -z "${node_version}" ]] && return
|
||||||
[[ "$node_version" =~ "$nvm_default" ]] && return
|
[[ "$node_version" =~ "$nvm_default" ]] && return
|
||||||
NODE_ICON=$'\u2B22' # ⬢
|
|
||||||
$1_prompt_segment "$0" "green" "011" "${node_version:1} $NODE_ICON"
|
$1_prompt_segment "$0" "green" "011" "${node_version:1} $(print_icon 'NODE_ICON')"
|
||||||
}
|
}
|
||||||
|
|
||||||
# rbenv information
|
# rbenv information
|
||||||
|
|
Loading…
Reference in a new issue