Skip to content

Commit d048151

Browse files
committed
Exit on failure to save COMMIT file
1 parent cc49950 commit d048151

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ build_php() {
8080
save_commit() {
8181
# Only store commit for unstable versions
8282
if [ "${stable:?}" = "false" ]; then
83-
basename "$(curl -sL https://api.github.com/repos/php/php-src/commits/"${branch:?}" | jq -r .commit.url)" | tee "$INSTALL_ROOT/etc/php/$PHP_VERSION/COMMIT" >/dev/null 2>&1
83+
commit="$(basename "$(curl -sL https://api.github.com/repos/php/php-src/commits/"${branch:?}" | jq -r .commit.url)")"
84+
[ "$commit" = 'null' ] && exit 1;
85+
echo "$commit" | tee "$INSTALL_ROOT/etc/php/$PHP_VERSION/COMMIT" >/dev/null 2>&1
8486
fi
8587
}
8688

0 commit comments

Comments
 (0)