Exit code for command fail (#4571)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 5 Mar 2019 07:21:40 +0000 (16:21 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 5 Mar 2019 07:21:40 +0000 (16:21 +0900)
Only exit with code when fail
Otherwise, just return

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
scripts/command/docker-run
scripts/command/docker-run-user
scripts/command/docker-shell

index ff08819..6303445 100644 (file)
@@ -7,4 +7,6 @@ EXITCODE=$?
 
 docker_cleanup
 
-exit $EXITCODE
+if [ $EXITCODE -ne 0 ]; then
+  exit $EXITCODE
+fi
index d5b74db..2036762 100644 (file)
@@ -7,4 +7,6 @@ DOCKER_RUN_OPTS+=" -u $(id -u):$(id -g)"
 docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME "$@"
 EXITCODE=$?
 
-exit $EXITCODE
+if [ $EXITCODE -ne 0 ]; then
+  exit $EXITCODE
+fi
index 1f942ce..f1c9d7c 100644 (file)
@@ -8,4 +8,6 @@ EXITCODE=$?
 
 docker_cleanup
 
-exit $EXITCODE
+if [ $EXITCODE -ne 0 ]; then
+  exit $EXITCODE
+fi