From 4695eb4e1db7465a4f8ecb4d0e5ac045eaf7cdf5 Mon Sep 17 00:00:00 2001 From: Ruslan Mstoi Date: Fri, 15 May 2020 16:02:36 +0300 Subject: [PATCH] scripts: net: Fix incorrect error messages If environment variables ZEPHYR_BASE or NET_TOOLS_BASE are unset, an incorrect message is printed saying that "it is set, but it is not a directory": $ZEPHYR_BASE is unset $ZEPHYR_BASE is set, but it is not a directory $NET_TOOLS_BASE is unset, no net-tools found $NET_TOOLS_BASE set, but it is not a directory This patch fixes that issue. Signed-off-by: Ruslan Mstoi --- scripts/net/run-sample-tests.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/net/run-sample-tests.sh b/scripts/net/run-sample-tests.sh index c9c0448393..470f834144 100755 --- a/scripts/net/run-sample-tests.sh +++ b/scripts/net/run-sample-tests.sh @@ -21,9 +21,7 @@ check_dirs () then echo '$ZEPHYR_BASE is unset' >&2 ret_zephyr=1 - fi - - if [ ! -d "$ZEPHYR_BASE" ] + elif [ ! -d "$ZEPHYR_BASE" ] then echo '$ZEPHYR_BASE is set, but it is not a directory' >&2 ret_zephyr=1 @@ -55,9 +53,7 @@ check_dirs () then echo '$NET_TOOLS_BASE is unset, no net-tools found' >&2 ret_net_tools=1 - fi - - if [ ! -d "$NET_TOOLS_BASE" ] + elif [ ! -d "$NET_TOOLS_BASE" ] then echo '$NET_TOOLS_BASE set, but it is not a directory' >&2 ret_net_tools=1