mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-16 17:50:09 +00:00
Add NVM prompt segment
Prints out the Node version that is currently active if it is different than the default version specified by NVM
This commit is contained in:
parent
62dee9824b
commit
7e6339ec27
1 changed files with 11 additions and 0 deletions
|
@ -752,6 +752,17 @@ prompt_php_version() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Node version from NVM
|
||||
# Only prints the segment if different than the default value
|
||||
prompt_nvm() {
|
||||
local node_version=$(nvm current)
|
||||
local nvm_default=$(cat $NVM_DIR/alias/default)
|
||||
[[ -z "${node_version}" ]] && return
|
||||
[[ "$node_version" =~ "$nvm_default" ]] && return
|
||||
NODE_ICON=$'\u2B22' # ⬢
|
||||
$1_prompt_segment "$0" "green" "011" "${node_version:1} $NODE_ICON"
|
||||
}
|
||||
|
||||
# rbenv information
|
||||
prompt_rbenv() {
|
||||
if [[ -n "$RBENV_VERSION" ]]; then
|
||||
|
|
Loading…
Reference in a new issue