Skip to content

Commit e30bd4b

Browse files
committed
Improve picking up package.xml files
1 parent e8592e0 commit e30bd4b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

extension-matrix/src/php-versions.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,21 @@ function compare_versions_using_package_xml() {
7171
php "$SCRIPT_DIR"/semver/semver.phar package.xml "$package_xml" "$php_versions"
7272
}
7373

74+
function get_package_json() {
75+
local directory=$1
76+
package_xmls=$(find "$directory" -name 'package*.xml')
77+
for file in $package_xmls; do
78+
grep -q '<php>' "$file" && echo "$file" && break
79+
done
80+
}
81+
7482
function get_php_versions() {
7583
directory=$(mktemp -d)
7684

7785
get_extension "$directory" > /dev/null 2>&1
7886

7987
composer_json="$(find "$directory" -name composer.json -exec sh -c 'jq -e ".type == \"php-ext\"" "$1" >/dev/null && echo "$1"' sh {} \; | head -n 1)"
80-
package_xml=$(find "$directory" -name package.xml)
88+
package_xml=$(get_package_json "$directory")
8189
if [ -n "$composer_json" ]; then
8290
compare_versions_using_composer "$directory" "$composer_json"
8391
rm -rf "$directory"

0 commit comments

Comments
 (0)