branch_coverage.sh: ignore clear-command errors
Open CI uses a docker container to build and produce coverage
reports but calling the 'branch_coverage.sh' command, which in turn
calls the 'clear' command, the following error is observed
.
.
12:54:34 # ../qa-tools/coverage-tool/coverage-reporting/branch_coverage.sh:133: main() - [4,0,0] clear
12:54:34 TERM environment variable not set.
12:54:34 LAVA JOB RESULT: 1
To avoid this problem, pipe the clear command with 'true', effectively
ignoring any error coming from clear command.
Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
diff --git a/coverage-tool/coverage-reporting/branch_coverage.sh b/coverage-tool/coverage-reporting/branch_coverage.sh
index 3dc88f3..f9d9a57 100755
--- a/coverage-tool/coverage-reporting/branch_coverage.sh
+++ b/coverage-tool/coverage-reporting/branch_coverage.sh
@@ -129,7 +129,10 @@
exit 1
fi
-clear
+# clear may fail within a container-enviroment due to lack of
+# TERM enviroment, so ignore this and other possible errors
+clear || true
+
echo "Generating intermediate layer file '$JSON_PATH'..."
python3 intermediate_layer.py --config-json "$CONFIG_JSON" --local-workspace $LOCAL_WORKSPACE
echo "Converting intermediate layer file to info file..."