scripts: list-defconfigs.sh: remove interleaves new lines from output

Github actions apparently chokes on new lines in the middle of the JSON,
so let's avoid them.

Signed-off-by: Ahmad Fatoum <a.fat...@pengutronix.de>
---
 scripts/list-defconfigs.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/list-defconfigs.sh b/scripts/list-defconfigs.sh
index d7516425f8e3..5eaaab51cc61 100755
--- a/scripts/list-defconfigs.sh
+++ b/scripts/list-defconfigs.sh
@@ -4,12 +4,13 @@
 # Output json formatted defconfig list for Github Action consumption
 ARCH=${@:-$(for a in arch/*/; do basename $a; done)}
 
-echo '{ "include" : [ '
+# Github chokes on interleaved new lines, thus use printf
+printf '{ "include" : [ '
 for arch in $ARCH; do
        make ARCH=$arch CROSS_COMPILE= help | \
                awk '/_defconfig/ { print $1  }' | \
                xargs -i printf '{ "arch": "%s", "config": "%s" }\n' \
                "$arch" "{}" | \
                paste -sd ',' -
-done | paste -sd ',' -
+done | paste -sd ',' - | tr -d '\n'
 echo '] }'
-- 
2.39.2


Reply via email to