summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Balykov <g.balykov@samsung.com>2020-07-14 18:19:04 +0300
committerAlexander Soldatov/AI Compiler Lab /SRR/Staff Engineer/Samsung Electronics <soldatov.a@samsung.com>2020-07-23 16:00:54 +0300
commit55e8bfbbdb0381868af27a09809e6b36c73b5e84 (patch)
treed8965bd852697b812bc67797f43a4dc6aeca4ece
parentf0f313a5bfed8aa7cdab2c56e55002ef71da6a55 (diff)
downloadcoreclr-55e8bfbbdb0381868af27a09809e6b36c73b5e84.tar.gz
coreclr-55e8bfbbdb0381868af27a09809e6b36c73b5e84.tar.bz2
coreclr-55e8bfbbdb0381868af27a09809e6b36c73b5e84.zip
[Tizen] Fix issue with return from non-sourced script if tools are already initialized
-rwxr-xr-xinit-tools.sh8
1 files changed, 7 insertions, 1 deletions
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