use string matching in php item

This commit is contained in:
Ilan Cosman 2023-07-06 21:31:57 -07:00
parent fb8e3bb6a3
commit 887d3abd0e

View File

@ -1,4 +1,6 @@
function _tide_item_php
path is $_tide_parent_dirs/composer.json &&
_tide_print_item php $tide_php_icon' ' (php --version | string match -r 'PHP ([\d.]+)')[2]
if path is $_tide_parent_dirs/composer.json
php --version | string match -qr "(?<ver>[\d.]+)"
_tide_print_item php "$tide_php_icon $ver"
end
end