run-build.sh: Re-run spe cmake config command only when error occurs
SPE cmake config command should only be re-run when there is config
error in the first time. It is redundant to re-run every time even
though there is no error with the first spe cmake config command.
Also, the build path is fixed in this patch.
Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
Change-Id: Ic2e8a92afe1be41bc515f613a0b677b3e18b1e9d
diff --git a/run-build.sh b/run-build.sh
index 7a9aec2..a8170cc 100755
--- a/run-build.sh
+++ b/run-build.sh
@@ -110,13 +110,13 @@
set +e
eval $spe_cmake_config_cmd
-cmake_cfg_error=$?
+declare -i cmake_cfg_error=$?
set -e
check_dependency_version
-if [ "$spe_cmake_config_cmd" != 0 ] ; then
- rm -rf ci_build/*
+if [ $cmake_cfg_error != 0 ] ; then
+ rm -rf ./*
eval $spe_cmake_config_cmd
fi
eval $spe_cmake_build_cmd