mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
config/functions: build_msg avoid outputting single space for 0 indent
This commit is contained in:
parent
d97b2b3793
commit
87c0981b28
@ -107,10 +107,14 @@ print_color() {
|
|||||||
# print build progress messages
|
# print build progress messages
|
||||||
# param1: message color, p2: label, p3: text, p4: indent (optional)
|
# param1: message color, p2: label, p3: text, p4: indent (optional)
|
||||||
build_msg() {
|
build_msg() {
|
||||||
|
local spaces
|
||||||
|
|
||||||
|
[ -n "${BUILD_INDENT}" ] && spaces="$(printf "%${BUILD_INDENT}c" " ")" || spaces=""
|
||||||
|
|
||||||
if [ -n "${3}" ]; then
|
if [ -n "${3}" ]; then
|
||||||
printf "%${BUILD_INDENT}c$(print_color "${1}" "${2}") ${3}\n" ' '>&${SILENT_OUT}
|
echo -e "${spaces}$(print_color "${1}" "${2}") ${3}" >&${SILENT_OUT}
|
||||||
else
|
else
|
||||||
printf "%${BUILD_INDENT}c$(print_color "${1}" "${2}")\n" ' '>&${SILENT_OUT}
|
echo -e "${spaces}$(print_color "${1}" "${2}")" >&${SILENT_OUT}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# pad left space to create "indent" effect
|
# pad left space to create "indent" effect
|
||||||
|
Loading…
x
Reference in New Issue
Block a user