@@ -162,19 +162,31 @@ trap_exit() {
162162
163163
164164build () {
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}
@@ -207,7 +219,7 @@ _help() {
207219share_options=" --noconfirm"
208220default_options=" -b -l -u alter -p alter"
209221
210- while getopts ' a:dghr:sc ' arg; do
222+ while getopts ' a:dghr:scm: ' arg; do
211223 case " ${arg} " in
212224 a) share_options=" ${share_options} ${OPTARG} " ;;
213225 c) all_channel=true ;;
0 commit comments