mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-19 20:29:45 +01:00
fix(jenv): quote % in jenv_prompt_info
This commit is contained in:
parent
42afa6e2ea
commit
e7390a8603
1 changed files with 8 additions and 2 deletions
|
@ -18,13 +18,19 @@ if [[ $FOUND_JENV -eq 1 ]]; then
|
||||||
(( $+commands[jenv] )) || export PATH="${jenvdir}/bin:$PATH"
|
(( $+commands[jenv] )) || export PATH="${jenvdir}/bin:$PATH"
|
||||||
eval "$(jenv init - zsh)"
|
eval "$(jenv init - zsh)"
|
||||||
|
|
||||||
function jenv_prompt_info() { jenv version-name 2>/dev/null }
|
function jenv_prompt_info() {
|
||||||
|
local version="$(jenv version-name 2>/dev/null)"
|
||||||
|
echo "${version:gs/%/%%}"
|
||||||
|
}
|
||||||
|
|
||||||
if [[ -d "${jenvdir}/versions" ]]; then
|
if [[ -d "${jenvdir}/versions" ]]; then
|
||||||
export JENV_ROOT=$jenvdir
|
export JENV_ROOT=$jenvdir
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
function jenv_prompt_info() { echo "system: $(java -version 2>&1 | cut -f 2 -d ' ')" }
|
function jenv_prompt_info() {
|
||||||
|
local version="$(java -version 2>&1 | cut -d' ' -f2)"
|
||||||
|
echo "system: ${version:gs/%/%%}"
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset jenvdir jenvdirs FOUND_JENV
|
unset jenvdir jenvdirs FOUND_JENV
|
||||||
|
|
Loading…
Reference in a new issue