fix(pyenv): quote % in pyenv_prompt_info

This commit is contained in:
Marc Cornellà 2021-12-26 19:32:52 +01:00
parent 5b076eab9b
commit 42afa6e2ea
No known key found for this signature in database
GPG Key ID: 0314585E776A9C1B

View File

@ -83,12 +83,14 @@ if [[ $FOUND_PYENV -eq 1 ]]; then
fi fi
function pyenv_prompt_info() { function pyenv_prompt_info() {
echo "$(pyenv version-name)" local version="$(pyenv version-name)"
echo "${version:gs/%/%%}"
} }
else else
# Fall back to system python # Fall back to system python
function pyenv_prompt_info() { function pyenv_prompt_info() {
echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')" local version="$(python -V 2>&1 | cut -d' ' -f2)"
echo "system: ${version:gs/%/%%}"
} }
fi fi