mirror of https://github.com/openXC7/prjxray.git
settings: Handle return code correctly
"eval $(python3 script.py)" does not handle the return code correctly and would try to evaluate the complete output of the Python traceback. Temporarily save the output in a variable and check the return code. If the RC is unequal to zero, return the RC and leave the bash script. Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
This commit is contained in:
parent
f562d6acfd
commit
969f1dd5ee
|
|
@ -33,4 +33,9 @@ export XRAY_ROI_GRID_Y2="51"
|
|||
|
||||
source $(dirname ${BASH_SOURCE[0]})/../utils/environment.sh
|
||||
|
||||
eval $(python3 ${XRAY_UTILS_DIR}/create_environment.py)
|
||||
env=`python3 ${XRAY_UTILS_DIR}/create_environment.py`
|
||||
ENV_RET=$?
|
||||
if [[ $ENV_RET != 0 ]] ; then
|
||||
return $ENV_RET
|
||||
fi
|
||||
eval $env
|
||||
|
|
|
|||
|
|
@ -23,4 +23,9 @@ export XRAY_IOI3_TILES="RIOI3_X105Y9 LIOI3_X0Y9"
|
|||
|
||||
source $(dirname ${BASH_SOURCE[0]})/../utils/environment.sh
|
||||
|
||||
eval $(python3 ${XRAY_UTILS_DIR}/create_environment.py)
|
||||
env=`python3 ${XRAY_UTILS_DIR}/create_environment.py`
|
||||
ENV_RET=$?
|
||||
if [[ $ENV_RET != 0 ]] ; then
|
||||
return $ENV_RET
|
||||
fi
|
||||
eval $env
|
||||
|
|
|
|||
|
|
@ -32,4 +32,9 @@ export XRAY_ROI_GRID_Y2="51"
|
|||
|
||||
source $(dirname ${BASH_SOURCE[0]})/../utils/environment.sh
|
||||
|
||||
eval $(python3 ${XRAY_UTILS_DIR}/create_environment.py)
|
||||
env=`python3 ${XRAY_UTILS_DIR}/create_environment.py`
|
||||
ENV_RET=$?
|
||||
if [[ $ENV_RET != 0 ]] ; then
|
||||
return $ENV_RET
|
||||
fi
|
||||
eval $env
|
||||
|
|
|
|||
|
|
@ -27,4 +27,9 @@ export XRAY_ROI_GRID_Y2="156"
|
|||
|
||||
source $(dirname ${BASH_SOURCE[0]})/../utils/environment.sh
|
||||
|
||||
eval $(python3 ${XRAY_UTILS_DIR}/create_environment.py)
|
||||
env=`python3 ${XRAY_UTILS_DIR}/create_environment.py`
|
||||
ENV_RET=$?
|
||||
if [[ $ENV_RET != 0 ]] ; then
|
||||
return $ENV_RET
|
||||
fi
|
||||
eval $env
|
||||
|
|
|
|||
|
|
@ -29,4 +29,9 @@ export XRAY_ROI_GRID_Y2="155"
|
|||
|
||||
source $(dirname ${BASH_SOURCE[0]})/../utils/environment.sh
|
||||
|
||||
eval $(python3 ${XRAY_UTILS_DIR}/create_environment.py)
|
||||
env=`python3 ${XRAY_UTILS_DIR}/create_environment.py`
|
||||
ENV_RET=$?
|
||||
if [[ $ENV_RET != 0 ]] ; then
|
||||
return $ENV_RET
|
||||
fi
|
||||
eval $env
|
||||
|
|
|
|||
|
|
@ -29,4 +29,9 @@ export XRAY_ROI_GRID_Y2="51"
|
|||
|
||||
source $(dirname ${BASH_SOURCE[0]})/../utils/environment.sh
|
||||
|
||||
eval $(python3 ${XRAY_UTILS_DIR}/create_environment.py)
|
||||
env=`python3 ${XRAY_UTILS_DIR}/create_environment.py`
|
||||
ENV_RET=$?
|
||||
if [[ $ENV_RET != 0 ]] ; then
|
||||
return $ENV_RET
|
||||
fi
|
||||
eval $env
|
||||
|
|
|
|||
Loading…
Reference in New Issue