Skip to content

Commit

Permalink
Added a error exit method
Browse files Browse the repository at this point in the history
  • Loading branch information
WolverinDEV committed Oct 13, 2019
1 parent 3e59efc commit 0b83e74
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions build_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,7 @@ function cmake_build() {
return 0
}

function check_err_exit() {
error_code=$?
[[ ${error_code} -eq 0 || "${error_code}" == "0" ]] && return 0
function err_exit() {
if [[ ${1} =~ __* ]]; then
echo -e "\e[1;31mFailed to build project ${1:2}. Status code: ${error_code}"
else
Expand All @@ -288,6 +286,12 @@ function check_err_exit() {
exit 1
}

function check_err_exit() {
error_code=$?
[[ ${error_code} -eq 0 || "${error_code}" == "0" ]] && return 0
err_exit $@
}

function pline() {
local width="150"
local padding="$(printf '%0.1s' ={1..120})"
Expand Down

0 comments on commit 0b83e74

Please sign in to comment.