diff options
author | James Conroy <james.conroy@arm.com> | 2022-04-20 17:16:50 +0100 |
---|---|---|
committer | James Conroy <james.conroy@arm.com> | 2022-05-03 18:08:35 +0100 |
commit | 04cd60384f5fc8455bb7cf64416daa7b001754d1 (patch) | |
tree | 7406d106d9906740787dd2e2cc8967f701414bc2 /profiling/buildpipe.sh | |
parent | ad813ecb139ca26701986656a144708155572773 (diff) | |
download | armnn-04cd60384f5fc8455bb7cf64416daa7b001754d1.tar.gz |
IVGCVSW-6924 Fix shellcheck warnings
* Fix shellcheck warnings, some have been
suppressed using shellcheck ignore.
Change-Id: Icae175a42bb348a58befb296949edca51713e977
Signed-off-by: James Conroy <james.conroy@arm.com>
Diffstat (limited to 'profiling/buildpipe.sh')
-rwxr-xr-x | profiling/buildpipe.sh | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/profiling/buildpipe.sh b/profiling/buildpipe.sh index 611b7b96e0..cacee8728c 100755 --- a/profiling/buildpipe.sh +++ b/profiling/buildpipe.sh @@ -16,10 +16,9 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli SOURCE="$DIR/$TARGET" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located fi done -RDIR="$( dirname "$SOURCE" )" DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" -CMD=$( basename $0 ) +CMD=$( basename "$0" ) usage() { echo "Usage: $CMD [options]" @@ -49,28 +48,32 @@ shift $((OPTIND - 1)) if [ $CLEAN == 1 ]; then echo "removing ${DIR}/build" - rm -rf ${DIR}/build + rm -rf "${DIR}"/build fi BUILD_DIR="build" -[ -d build ] || mkdir build +[ -d build ] || ( mkdir build || exit ) echo $WINDOWS if [ "$WINDOWS" -eq "1" ]; then echo "doing windows" - cd $BUILD_DIR + cd $BUILD_DIR || exit [ -d windows ] || mkdir windows BUILD_DIR=$BUILD_DIR/windows - cd $DIR + cd "$DIR" || exit fi # lower case TYPE in a posix compliant manner LC_TYPE=$(echo "$TYPE" | tr '[:upper:]' '[:lower:]') -if [ ${LC_TYPE} == "debug" ]; then - DEBUGDIR=($DIR/$BUILD_DIR/debug) - [ -d $DEBUGDIR ] || (cd ${BUILD_DIR} && mkdir debug && cd ..) +if [ "${LC_TYPE}" == "debug" ]; then + DEBUGDIR=("$DIR/$BUILD_DIR/debug") + # shellcheck disable=SC2128 + [ -d "$DEBUGDIR" ] || (cd ${BUILD_DIR} && ( mkdir debug || exit ) && cd ..) + # shellcheck disable=SC2128 BUILD_DIR=$DEBUGDIR else - RELEASEDIR=($DIR/$BUILD_DIR/release) - [ -d $RELEASEDIR ] || (cd ${BUILD_DIR} && mkdir release && cd ..) + RELEASEDIR=("$DIR/$BUILD_DIR/release") + # shellcheck disable=SC2128 + [ -d "$RELEASEDIR" ] || (cd "${BUILD_DIR}" && ( mkdir release || exit ) && cd ..) + # shellcheck disable=SC2128 BUILD_DIR=$RELEASEDIR fi @@ -84,8 +87,8 @@ if [ "$WINDOWS" -eq "1" ]; then CMARGS="$CMARGS \ -DCMAKE_TOOLCHAIN_FILE=${DIR}/toolchain-x86-ubuntu-mingw64.cmake" fi -MAKE=make +MAKE="make" -cd ${BUILD_DIR} +cd "${BUILD_DIR}" || exit pwd -( eval $CMAKE $CMARGS $DIR && eval ${MAKE} $MAKEFLAGS ) +( eval $CMAKE "$CMARGS" "$DIR" && eval ${MAKE} "$MAKEFLAGS" ) |