From c8cd2303ba6d948dd61f79c7c012f4d541229bb7 Mon Sep 17 00:00:00 2001 From: hayao Date: Thu, 1 Oct 2020 18:36:42 +0900 Subject: [PATCH] [update] : Added exit code judgment --- fullbuild.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/fullbuild.sh b/fullbuild.sh index 980d9e25..e88b4dbb 100755 --- a/fullbuild.sh +++ b/fullbuild.sh @@ -162,19 +162,31 @@ trap_exit() { build() { + local _exit_code=0 + options="${share_options} -a ${arch} ${cha}" if [[ ! -e "${work_dir}/fullbuild.${cha}_${arch}" ]]; then _msg_info "Build ${cha} with ${arch} architecture." sudo bash ${script_path}/build.sh ${options} - touch "${work_dir}/fullbuild.${cha}_${arch}" + _exit_code="${?}" + if [[ "${_exit_code}" = 0 ]]; then + touch "${work_dir}/fullbuild.${cha}_${arch}" + else + _msg_error "build.sh finished with exit code ${_exit_code}. Will try again." + fi fi sudo pacman -Sccc --noconfirm > /dev/null 2>&1 if [[ ! -e "${work_dir}/fullbuild.${cha}_${arch}_jp" ]]; then _msg_info "Build the Japanese version of ${cha} on the ${arch} architecture." sudo bash ${script_path}/build.sh -j ${options} - touch "${work_dir}/fullbuild.${cha}_${arch}_jp" + _exit_code="${?}" + if [[ "${_exit_code}" = 0 ]]; then + touch "${work_dir}/fullbuild.${cha}_${arch}_jp" + else + _msg_error "build.sh finished with exit code ${_exit_code}. Will try again." + fi fi sudo pacman -Sccc --noconfirm > /dev/null 2>&1 } -- 2.11.0