pull/1946/merge
Konstantin Gredeskoul 2023-03-17 13:00:30 +02:00 committed by GitHub
commit 4de68f2c4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 6 deletions

View File

@ -390,6 +390,27 @@ function hg_prompt_vars() {
fi fi
} }
function node_command_version_prompt() {
local node_version
if _command_exists node; then
node_version="$(node --version 2> /dev/null)"
if [[ -n ${node_version} ]]; then
echo -e "${NVM_THEME_PROMPT_PREFIX}${node_version}${NVM_THEME_PROMPT_SUFFIX}"
fi
fi
}
function node_version_prompt() {
local node_version
node_version="$(nvm_version_prompt)"
if [[ -z "${node_version}" ]]; then
node_version="$(node_command_version_prompt)"
fi
if [[ -n "${node_version}" ]]; then
echo -e "${node_version}"
fi
}
function nvm_version_prompt() { function nvm_version_prompt() {
local node local node
if _is_function nvm; then if _is_function nvm; then
@ -399,10 +420,6 @@ function nvm_version_prompt() {
fi fi
} }
function node_version_prompt() {
nvm_version_prompt
}
function rvm_version_prompt() { function rvm_version_prompt() {
if _command_exists rvm; then if _command_exists rvm; then
rvm="$(rvm-prompt)" || return rvm="$(rvm-prompt)" || return

View File

@ -40,13 +40,13 @@ SCM_THEME_PROMPT_COLOR=${SCM_THEME_PROMPT_CLEAN_COLOR}
NVM_THEME_PROMPT_PREFIX="" NVM_THEME_PROMPT_PREFIX=""
NVM_THEME_PROMPT_SUFFIX="" NVM_THEME_PROMPT_SUFFIX=""
NODE_CHAR=${POWERLINE_NODE_CHAR:="n "} NODE_CHAR=${POWERLINE_NODE_CHAR:="n "}
NODE_THEME_PROMPT_COLOR=${POWERLINE_NODE_COLOR:=22} NODE_THEME_PROMPT_COLOR=${POWERLINE_NODE_COLOR:=28}
RVM_THEME_PROMPT_PREFIX="" RVM_THEME_PROMPT_PREFIX=""
RVM_THEME_PROMPT_SUFFIX="" RVM_THEME_PROMPT_SUFFIX=""
RBENV_THEME_PROMPT_PREFIX="" RBENV_THEME_PROMPT_PREFIX=""
RBENV_THEME_PROMPT_SUFFIX="" RBENV_THEME_PROMPT_SUFFIX=""
RUBY_THEME_PROMPT_COLOR=${POWERLINE_RUBY_COLOR:=161} RUBY_THEME_PROMPT_COLOR=${POWERLINE_RUBY_COLOR:=1}
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="r "} RUBY_CHAR=${POWERLINE_RUBY_CHAR:="r "}
TERRAFORM_THEME_PROMPT_COLOR=${POWERLINE_TERRAFORM_COLOR:=161} TERRAFORM_THEME_PROMPT_COLOR=${POWERLINE_TERRAFORM_COLOR:=161}