OSDN Git Service

[update] : Added script exit code
authorhayao <shun819.mail@gmail.com>
Sun, 2 Aug 2020 04:38:23 +0000 (13:38 +0900)
committerhayao <shun819.mail@gmail.com>
Sun, 2 Aug 2020 04:38:23 +0000 (13:38 +0900)
fullbuild.sh

index 8183b0c..2afe7f4 100755 (executable)
@@ -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
 }