Agnoster: add current node version if .nvmrc is present

Useful with nvm autoswitcher upon directory change (as described in nvm package)
This commit is contained in:
Ilya Sheershoff 2016-06-27 15:18:33 +05:00 committed by GitHub
parent 7fabc8bca4
commit d4064cdc66

View File

@ -167,6 +167,13 @@ prompt_dir() {
prompt_segment blue black '%~' prompt_segment blue black '%~'
} }
# Nvm: current node version if nvmrc is present.
prompt_nvm() {
if [[ -f .nvmrc && -r .nvmrc ]]; then
prompt_segment black green "⬡ $(nvm_prompt_info)"
fi
}
# Virtualenv: current working virtualenv # Virtualenv: current working virtualenv
prompt_virtualenv() { prompt_virtualenv() {
local virtualenv_path="$VIRTUAL_ENV" local virtualenv_path="$VIRTUAL_ENV"
@ -194,6 +201,7 @@ build_prompt() {
RETVAL=$? RETVAL=$?
prompt_status prompt_status
prompt_virtualenv prompt_virtualenv
prompt_nvm
prompt_context prompt_context
prompt_dir prompt_dir
prompt_git prompt_git