Fail-fast if input repository does not have a PHP extension

This commit is contained in:
Shivam Mathur 2021-03-11 10:14:56 +05:30
parent f5f14c3aa3
commit c870bc9a3a
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -329,11 +329,16 @@ add_extension_from_github() {
delete_extension "$extension" delete_extension "$extension"
git clone -q -n https://github.com/"$org"/"$repo" /tmp/"$repo-$release" git clone -q -n https://github.com/"$org"/"$repo" /tmp/"$repo-$release"
cd /tmp/"$repo-$release" || exit 1 cd /tmp/"$repo-$release" || exit 1
git checkout -q "$release" && git submodule -q update --init --recursive git checkout -q "$release"
if [ "$(find . -maxdepth 1 -name '*.m4' -exec grep -H 'PHP_NEW_EXTENSION' {} \;| wc -l)" != "0" ]; then
git submodule -q update --init --recursive
add_libs "${libs[@]}" add_libs "${libs[@]}"
phpize && sudo "${prefix_opts[@]}" ./configure "${suffix_opts[@]}" "${opts[@]}" phpize && sudo "${prefix_opts[@]}" ./configure "${suffix_opts[@]}" "${opts[@]}"
sudo make -j"$(nproc 2>/dev/null || sysctl -n hw.ncpu)" && sudo make install sudo make -j"$(nproc 2>/dev/null || sysctl -n hw.ncpu)" && sudo make install
enable_extension "$extension" "$prefix" enable_extension "$extension" "$prefix"
else
add_log "$cross" "$slug" "Provided repository does not contain a PHP extension"
fi
) | sudo tee "/tmp/$extension@$release.log" >/dev/null ) | sudo tee "/tmp/$extension@$release.log" >/dev/null
add_extension_log "$slug" "Installed and enabled" add_extension_log "$slug" "Installed and enabled"
printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "$slug" "Click to get the logs of compiling $extension" printf "::group::\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" "$slug" "Click to get the logs of compiling $extension"