diff --git a/config/functions b/config/functions index c3954501a1..c36d1ac633 100644 --- a/config/functions +++ b/config/functions @@ -107,10 +107,14 @@ print_color() { # print build progress messages # param1: message color, p2: label, p3: text, p4: indent (optional) build_msg() { + local spaces + + [ -n "${BUILD_INDENT}" ] && spaces="$(printf "%${BUILD_INDENT}c" " ")" || spaces="" + 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 - printf "%${BUILD_INDENT}c$(print_color "${1}" "${2}")\n" ' '>&${SILENT_OUT} + echo -e "${spaces}$(print_color "${1}" "${2}")" >&${SILENT_OUT} fi # pad left space to create "indent" effect