1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-29 06:40:08 +00:00

add POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY; use PHP_ICON in php_version

This commit is contained in:
romkatv 2020-02-15 13:46:42 +01:00
parent 245a420499
commit 04e0cfa670

View file

@ -2425,10 +2425,13 @@ instant_prompt_os_icon() { prompt_os_icon; }
################################################################ ################################################################
# Segment to display PHP version number # Segment to display PHP version number
prompt_php_version() { prompt_php_version() {
if (( _POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY )); then
_p9k_upglob 'composer.json|*.php' && return
fi
_p9k_cached_cmd_stdout php --version || return _p9k_cached_cmd_stdout php --version || return
[[ $_p9k__ret == (#b)(*$'\n')#(PHP [[:digit:].]##)* ]] || return [[ $_p9k__ret == (#b)(*$'\n')#(PHP [[:digit:].]##)* ]] || return
local v=$match[2] local v=$match[2]
_p9k_prompt_segment "$0" "fuchsia" "grey93" '' 0 '' "${v//\%/%%}" _p9k_prompt_segment "$0" "fuchsia" "grey93" 'PHP_ICON' 0 '' "${v//\%/%%}"
} }
_p9k_prompt_php_version_init() { _p9k_prompt_php_version_init() {
@ -6331,6 +6334,7 @@ _p9k_init_params() {
esac esac
_p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0 _p9k_declare -b POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW 0
_p9k_declare -b POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY 0 _p9k_declare -b POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY 0
_p9k_declare -b POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY 0
_p9k_declare -b POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY 1 _p9k_declare -b POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY 1
_p9k_declare -b POWERLEVEL9K_GO_VERSION_PROJECT_ONLY 1 _p9k_declare -b POWERLEVEL9K_GO_VERSION_PROJECT_ONLY 1
_p9k_declare -b POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY 1 _p9k_declare -b POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY 1