mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-18 13:41:56 +00:00
Added a segment that shows the PHP version.
This commit is contained in:
parent
6e4d24f50d
commit
26a41f14b8
2 changed files with 11 additions and 0 deletions
|
@ -236,6 +236,7 @@ currently available are:
|
||||||
* **history** - The command number for the current line.
|
* **history** - The command number for the current line.
|
||||||
* **node_version** - Show the version number of the installed Node.js.
|
* **node_version** - Show the version number of the installed Node.js.
|
||||||
* **os_icon** - Display a nice little icon, depending on your operating system.
|
* **os_icon** - Display a nice little icon, depending on your operating system.
|
||||||
|
* **php_version** - Show the current PHP version.
|
||||||
* **rbenv** - Ruby environment information (if one is active).
|
* **rbenv** - Ruby environment information (if one is active).
|
||||||
* **rspec_stats** - Show a ratio of test classes vs code classes for RSpec.
|
* **rspec_stats** - Show a ratio of test classes vs code classes for RSpec.
|
||||||
* **status** - The return code of the previous command, and status of background jobs.
|
* **status** - The return code of the previous command, and status of background jobs.
|
||||||
|
|
|
@ -556,6 +556,16 @@ prompt_os_icon() {
|
||||||
$1_prompt_segment "$0" "008" "255" "$OS_ICON"
|
$1_prompt_segment "$0" "008" "255" "$OS_ICON"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# print PHP version number
|
||||||
|
prompt_php_version() {
|
||||||
|
local php_version
|
||||||
|
php_version=$(php -v 2>&1 | grep -oe "^PHP\s*[0-9.]*")
|
||||||
|
|
||||||
|
if [[ -n "$php_version" ]]; then
|
||||||
|
$1_prompt_segment "$0" "013" "255" "$php_version"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# rbenv information
|
# rbenv information
|
||||||
prompt_rbenv() {
|
prompt_rbenv() {
|
||||||
if [[ -n "$RBENV_VERSION" ]]; then
|
if [[ -n "$RBENV_VERSION" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue