mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-10-25 07:10:52 +02:00
Only show log info when something has been logged
This commit is contained in:
parent
a7dc9b120a
commit
9463182dec
1 changed files with 19 additions and 3 deletions
|
|
@ -28,13 +28,29 @@ build_failed() {
|
|||
echo "BUILD FAILED"
|
||||
echo
|
||||
echo "Inspect or clean up the working tree at ${TEMP_PATH}"
|
||||
echo "Results logged to ${LOG_PATH}"
|
||||
echo "Last 10 log lines:"
|
||||
tail -n 10 $LOG_PATH
|
||||
|
||||
if file_is_not_empty "$LOG_PATH"; then
|
||||
echo "Results logged to ${LOG_PATH}"
|
||||
echo
|
||||
echo "Last 10 log lines:"
|
||||
tail -n 10 "$LOG_PATH"
|
||||
fi
|
||||
} >&3
|
||||
exit 1
|
||||
}
|
||||
|
||||
file_is_not_empty() {
|
||||
local filename="$1"
|
||||
local line_count="$(wc -l "$filename" 2>/dev/null || true)"
|
||||
|
||||
if [ -n "$line_count" ]; then
|
||||
words=( $line_count )
|
||||
[ "${words[0]}" -gt 0 ]
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
install_package() {
|
||||
install_package_using "tarball" 1 $*
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue