Fix catch exit code failed caused by (#26934)

revert-26856-strategy_example2
LoveAn 5 years ago committed by GitHub
parent 61fc7a3e45
commit 26c698e2c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -273,7 +273,7 @@ function cmake_gen() {
function abort(){ function abort(){
echo "Your change doesn't follow PaddlePaddle's code style." 1>&2 echo "Your change doesn't follow PaddlePaddle's code style." 1>&2
echo "Please use pre-commit to check what is wrong." 1>&2 echo "Please use pre-commit to check what is wrong." 1>&2
exit 1 exit 4
} }
function check_style() { function check_style() {
@ -303,7 +303,7 @@ function check_style() {
if [ $commit_files == 'off' ];then if [ $commit_files == 'off' ];then
echo "code format error" echo "code format error"
exit 1 exit 4
fi fi
trap : 0 trap : 0
} }
@ -1427,6 +1427,7 @@ function main() {
cmake_gen_and_build ${PYTHON_ABI:-""} ${parallel_number} cmake_gen_and_build ${PYTHON_ABI:-""} ${parallel_number}
;; ;;
build_and_check) build_and_check)
set +e
$(check_style >&2) $(check_style >&2)
check_style_code=$? check_style_code=$?
generate_upstream_develop_api_spec ${PYTHON_ABI:-""} ${parallel_number} generate_upstream_develop_api_spec ${PYTHON_ABI:-""} ${parallel_number}

Loading…
Cancel
Save