1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-12-22 12:48:01 +00:00

python-info: avoid setting python_info[version] if python is not on the PATH

This commit is contained in:
Kaleb Elwert 2017-12-04 12:08:45 -08:00
parent b407ba0c3a
commit 64d57ec71f

View File

@ -32,10 +32,12 @@ if [[ -n "$CONDA_DEFAULT_ENV" ]]; then
python_info[virtualenv]="$virtualenv_formatted" python_info[virtualenv]="$virtualenv_formatted"
fi fi
zstyle -s ':prezto:module:python:info:version' format 'version_format' if (( $+commands[python] )); then
if [[ -n "$version_format" ]]; then zstyle -s ':prezto:module:python:info:version' format 'version_format'
zformat -f version_formatted "$version_format" "v:${$(python3 --version)#Python }" if [[ -n "$version_format" ]]; then
python_info[version]="$version_formatted" zformat -f version_formatted "$version_format" "v:${$(python3 --version)#Python }"
python_info[version]="$version_formatted"
fi
fi fi
# } # }