From 26c698e2c9ee4f8c258e41b8d67496b4bd6587ca Mon Sep 17 00:00:00 2001 From: LoveAn Date: Thu, 3 Sep 2020 10:34:54 +0800 Subject: [PATCH] Fix catch exit code failed caused by (#26934) --- paddle/scripts/paddle_build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 6414b78172b..33472397dd0 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -273,7 +273,7 @@ function cmake_gen() { function abort(){ echo "Your change doesn't follow PaddlePaddle's code style." 1>&2 echo "Please use pre-commit to check what is wrong." 1>&2 - exit 1 + exit 4 } function check_style() { @@ -303,7 +303,7 @@ function check_style() { if [ $commit_files == 'off' ];then echo "code format error" - exit 1 + exit 4 fi trap : 0 } @@ -1427,6 +1427,7 @@ function main() { cmake_gen_and_build ${PYTHON_ABI:-""} ${parallel_number} ;; build_and_check) + set +e $(check_style >&2) check_style_code=$? generate_upstream_develop_api_spec ${PYTHON_ABI:-""} ${parallel_number} -- GitLab