From 129dbc0c131a96163c5e143c6de3693ac444e3f8 Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Thu, 3 Jan 2019 15:54:33 -0700 Subject: [PATCH] fix shellcheck issues in build.sh --- build.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index b910557..d0219af 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ set -e -TPUT=$(which tput 2>/dev/null || echo true) +TPUT=$(command -v tput 2>/dev/null || echo true) DIR=$(cd "$(dirname "$0")"; pwd -P) @@ -11,7 +11,7 @@ TOOLCHAIN_IMAGE="esp32-toolchain:latest" DOCKERFILE="$DIR/Dockerfile" echo_status() { - echo "$($TPUT setaf 2)==> $@$($TPUT sgr0)" + echo "$($TPUT setaf 2)==> $*$($TPUT sgr0)" } get_docker_run_flags() { @@ -23,7 +23,7 @@ get_docker_run_flags() { fi USB_SERIAL_DEVICES=$(find /dev -name 'ttyUSB0' -o -name 'ttyACM*') for device in $USB_SERIAL_DEVICES; do - DOCKER_RUN_FLAGS+=(--device $device) + DOCKER_RUN_FLAGS+=(--device "$device") echo_status "Adding device $device to container" done fi @@ -38,7 +38,7 @@ build_docker_container() { build_docker() { build_docker_container get_docker_run_flags - local targets="$@" + local targets=$* if [ -z "$targets" ]; then targets="all" fi @@ -55,7 +55,7 @@ build_cmake() { cd "$BUILD_DIR" echo_status "CMake configure" cmake -G Ninja "$DIR" - echo_status "CMake build $@" + echo_status "CMake build $*" cmake --build "$BUILD_DIR" -- "$@" }