Only remove the last dot if it is an X.Y.Z version number

This commit is contained in:
Ben Ramsey
2019-12-03 18:07:07 -08:00
parent 8f452d591a
commit 6e48780731
+6 -1
View File
@@ -6,7 +6,12 @@
# on the local system, rather than in a container.
php_version="${TRAVIS_PHP_VERSION:-$(php -r "echo phpversion();")}"
php_version="${php_version%.*}"
dots_count=$(echo $php_version | awk -F"." '{print NF-1}')
if [ $dots_count -ge 2 ]; then
php_version="${php_version%.*}"
fi
architecture="${ARCH:-${TRAVIS_CPU_ARCH:-$(uname -m)}}"
cmd_proxy=""