1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Example clarifies how regexp's extract PHP version #

This commit is contained in:
A Holt 2019-07-04 19:18:24 -04:00 committed by GitHub
parent f40589c86d
commit 6364fa4dad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,6 +19,7 @@
# INSPIRED BY: github.com/iiab/iiab/blob/master/roles/nodejs/tasks/main.yml#L10-L54
- name: Try to run 'php -v' to get PHP version
# e.g. converts multi-line "PHP 7.0.33-0ubuntu0.16.04.5 (cli) ( NTS ) ..." to "7.0.33"
shell: php -v | head -1 | sed 's/^[^0-9.]*//' | sed 's/[^0-9.].*//'
register: php_version_installed
#ignore_errors: yes # NOT NEC: if php is not installed, php_version_installed.stdout will get set to ""