From edaa6a22da8ad466f648dd6b293ab305b6224def Mon Sep 17 00:00:00 2001 From: hayao Date: Sun, 2 Aug 2020 13:38:23 +0900 Subject: [PATCH] [update] : Added script exit code --- fullbuild.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fullbuild.sh b/fullbuild.sh index 8183b0c7..2afe7f44 100755 --- a/fullbuild.sh +++ b/fullbuild.sh @@ -167,16 +167,23 @@ trap_exit() { build() { + local _exit_code=0 + options="${share_options} -a ${arch} -g ${lang} ${cha}" if [[ ! -e "${work_dir}/fullbuild.${cha}_${arch}_${lang}" ]]; then if [[ "${simulation}" = true ]]; then echo "build.sh ${share_options} -a ${arch} -g ${lang} ${cha}" + _exit_code="${?}" else _msg_info "Build the ${lang} version of ${cha} on the ${arch} architecture." sudo bash ${script_path}/build.sh ${options} + _exit_code="${?}" fi - touch "${work_dir}/fullbuild.${cha}_${arch}_${lang}" + if [[ "${_exit_code}" == 0 ]]; then + touch "${work_dir}/fullbuild.${cha}_${arch}_${lang}" + else + _msg_error "build.sh finished with exit code ${_exit_code}. Will try again." fi sudo pacman -Sccc --noconfirm > /dev/null 2>&1 } -- 2.11.0