dist/tools/ci: Fix whitespace handling in command output

All newlines were stripped before and leading whitespace was trimmed
which made the output very difficult to read.
This commit is contained in:
Joakim Nohlgård 2017-01-17 12:58:45 +01:00
parent b24be6a6ae
commit 39d02c9ccf

View File

@ -43,7 +43,7 @@ function run {
OUT_LENGTH="$(echo -n $OUT | wc -c)"
if (( "$OUT_LENGTH" > 0 )); then
echo -e "Command output:\n"
(echo $OUT | while read -r line; do echo -ne "\t"; echo $line; done)
(printf "%s" "$OUT" | while IFS= read -r line; do printf "\t%s\n" "$line"; done)
echo ""
fi
}