From 55e8bfbbdb0381868af27a09809e6b36c73b5e84 Mon Sep 17 00:00:00 2001 From: Gleb Balykov Date: Tue, 14 Jul 2020 18:19:04 +0300 Subject: [Tizen] Fix issue with return from non-sourced script if tools are already initialized --- init-tools.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init-tools.sh b/init-tools.sh index 5ac2b44d7d..5f0fb640a9 100755 --- a/init-tools.sh +++ b/init-tools.sh @@ -17,7 +17,13 @@ __BUILD_TOOLS_SEMAPHORE="$__TOOLRUNTIME_DIR/$__BUILD_TOOLS_PACKAGE_VERSION/init- if [ -e "$__BUILD_TOOLS_SEMAPHORE" ]; then echo "Tools are already initialized" - return #return instead of exit because this script is inlined in other scripts which we don't want to exit + if [ "$0" = "$BASH_SOURCE" ]; then + # not sourced + exit 0 + else + # sourced + return #return instead of exit because this script is inlined in other scripts which we don't want to exit + fi fi if [ -e "$__TOOLRUNTIME_DIR" ]; then rm -rf -- "$__TOOLRUNTIME_DIR"; fi -- cgit v1.2.3