Fix some of shellcheck errors in setupvars.sh (#12623)

Fixed:
SC2070: -n doesn't work with unquoted arguments. Quote or use [[ ]].
SC2086: Double quote to prevent globbing and word splitting
in TBB related part of the script.
This commit is contained in:
Mateusz Tabaka 2022-08-18 22:05:50 +02:00 committed by GitHub
parent d5e0be34da
commit 37a0bddd76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,14 +48,14 @@ if [ -e "$INSTALLDIR/runtime" ]; then
if [ -e "$INSTALLDIR/runtime/3rdparty/tbb" ]; then
tbb_lib_path=$INSTALLDIR/runtime/3rdparty/tbb/lib
if [ -d $tbb_lib_path/$system_type ]; then
lib_path=$(find $tbb_lib_path/$system_type -name "libtbb*" | sort -r | head -n1)
if [ -n $lib_path ]; then
tbb_lib_path=$(dirname $lib_path)
if [ -d "$tbb_lib_path/$system_type" ]; then
lib_path=$(find "$tbb_lib_path/$system_type" -name "libtbb*" | sort -r | head -n1)
if [ -n "$lib_path" ]; then
tbb_lib_path=$(dirname "$lib_path")
fi
fi
if ls $tbb_lib_path/libtbb* >/dev/null 2>&1; then
if ls "$tbb_lib_path"/libtbb* >/dev/null 2>&1; then
if [[ "$OSTYPE" == "darwin"* ]]; then
export DYLD_LIBRARY_PATH=$tbb_lib_path:${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}
fi