make.sh: Create a custom log function

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2024-07-05 09:39:08 +00:00
parent 711a047b66
commit 74371ed5b6

15
make.sh
View File

@@ -95,6 +95,21 @@ resize_terminal
# Call resize_terminal when terminal is being resized
trap "resize_terminal" WINCH
# Writes a line to the log file
log() {
local line="$@"
# Fetch the current timestamp
local t="$(date -u "+%b %e %T")"
# Append the line to file
if [ -w "${LOGFILE}" ]; then
echo "${t}: ${line}" >> "${LOGFILE}"
fi
return 0
}
find_base() {
local path