Skip to content
This repository was archived by the owner on Dec 23, 2018. It is now read-only.

Commit 8948c09

Browse files
committed
Automatically delete $TEMP_PATH if it's empty
1 parent 17ccef2 commit 8948c09

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

bin/php-build

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@ build_failed() {
2727
{ echo
2828
echo "BUILD FAILED"
2929
echo
30-
echo "Inspect or clean up the working tree at ${TEMP_PATH}"
3130

32-
if file_is_not_empty "$LOG_PATH"; then
33-
echo "Results logged to ${LOG_PATH}"
34-
echo
35-
echo "Last 10 log lines:"
36-
tail -n 10 "$LOG_PATH"
31+
if ! rmdir "${TEMP_PATH}" 2>/dev/null; then
32+
echo "Inspect or clean up the working tree at ${TEMP_PATH}"
33+
34+
if file_is_not_empty "$LOG_PATH"; then
35+
echo "Results logged to ${LOG_PATH}"
36+
echo
37+
echo "Last 10 log lines:"
38+
tail -n 10 "$LOG_PATH"
39+
fi
3740
fi
3841
} >&3
3942
exit 1

0 commit comments

Comments
 (0)