mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Fail-fast if input repository does not have a PHP extension
This commit is contained in:
parent
f5f14c3aa3
commit
c870bc9a3a
@ -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"
|
||||||
add_libs "${libs[@]}"
|
if [ "$(find . -maxdepth 1 -name '*.m4' -exec grep -H 'PHP_NEW_EXTENSION' {} \;| wc -l)" != "0" ]; then
|
||||||
phpize && sudo "${prefix_opts[@]}" ./configure "${suffix_opts[@]}" "${opts[@]}"
|
git submodule -q update --init --recursive
|
||||||
sudo make -j"$(nproc 2>/dev/null || sysctl -n hw.ncpu)" && sudo make install
|
add_libs "${libs[@]}"
|
||||||
enable_extension "$extension" "$prefix"
|
phpize && sudo "${prefix_opts[@]}" ./configure "${suffix_opts[@]}" "${opts[@]}"
|
||||||
|
sudo make -j"$(nproc 2>/dev/null || sysctl -n hw.ncpu)" && sudo make install
|
||||||
|
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user