Skip to content

Commit c8cd230

Browse files
committed
[update] : Added exit code judgment
1 parent 54d16da commit c8cd230

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

fullbuild.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,31 @@ trap_exit() {
162162

163163

164164
build() {
165+
local _exit_code=0
166+
165167
options="${share_options} -a ${arch} ${cha}"
166168

167169
if [[ ! -e "${work_dir}/fullbuild.${cha}_${arch}" ]]; then
168170
_msg_info "Build ${cha} with ${arch} architecture."
169171
sudo bash ${script_path}/build.sh ${options}
170-
touch "${work_dir}/fullbuild.${cha}_${arch}"
172+
_exit_code="${?}"
173+
if [[ "${_exit_code}" = 0 ]]; then
174+
touch "${work_dir}/fullbuild.${cha}_${arch}"
175+
else
176+
_msg_error "build.sh finished with exit code ${_exit_code}. Will try again."
177+
fi
171178
fi
172179
sudo pacman -Sccc --noconfirm > /dev/null 2>&1
173180

174181
if [[ ! -e "${work_dir}/fullbuild.${cha}_${arch}_jp" ]]; then
175182
_msg_info "Build the Japanese version of ${cha} on the ${arch} architecture."
176183
sudo bash ${script_path}/build.sh -j ${options}
177-
touch "${work_dir}/fullbuild.${cha}_${arch}_jp"
184+
_exit_code="${?}"
185+
if [[ "${_exit_code}" = 0 ]]; then
186+
touch "${work_dir}/fullbuild.${cha}_${arch}_jp"
187+
else
188+
_msg_error "build.sh finished with exit code ${_exit_code}. Will try again."
189+
fi
178190
fi
179191
sudo pacman -Sccc --noconfirm > /dev/null 2>&1
180192
}

0 commit comments

Comments
 (0)