Browse Source

fix shellcheck issues in build.sh

ugv_io
Alex Mikhalev 6 years ago
parent
commit
129dbc0c13
  1. 10
      build.sh

10
build.sh

@ -2,7 +2,7 @@
set -e 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) DIR=$(cd "$(dirname "$0")"; pwd -P)
@ -11,7 +11,7 @@ TOOLCHAIN_IMAGE="esp32-toolchain:latest"
DOCKERFILE="$DIR/Dockerfile" DOCKERFILE="$DIR/Dockerfile"
echo_status() { echo_status() {
echo "$($TPUT setaf 2)==> $@$($TPUT sgr0)" echo "$($TPUT setaf 2)==> $*$($TPUT sgr0)"
} }
get_docker_run_flags() { get_docker_run_flags() {
@ -23,7 +23,7 @@ get_docker_run_flags() {
fi fi
USB_SERIAL_DEVICES=$(find /dev -name 'ttyUSB0' -o -name 'ttyACM*') USB_SERIAL_DEVICES=$(find /dev -name 'ttyUSB0' -o -name 'ttyACM*')
for device in $USB_SERIAL_DEVICES; do for device in $USB_SERIAL_DEVICES; do
DOCKER_RUN_FLAGS+=(--device $device) DOCKER_RUN_FLAGS+=(--device "$device")
echo_status "Adding device $device to container" echo_status "Adding device $device to container"
done done
fi fi
@ -38,7 +38,7 @@ build_docker_container() {
build_docker() { build_docker() {
build_docker_container build_docker_container
get_docker_run_flags get_docker_run_flags
local targets="$@" local targets=$*
if [ -z "$targets" ]; then if [ -z "$targets" ]; then
targets="all" targets="all"
fi fi
@ -55,7 +55,7 @@ build_cmake() {
cd "$BUILD_DIR" cd "$BUILD_DIR"
echo_status "CMake configure" echo_status "CMake configure"
cmake -G Ninja "$DIR" cmake -G Ninja "$DIR"
echo_status "CMake build $@" echo_status "CMake build $*"
cmake --build "$BUILD_DIR" -- "$@" cmake --build "$BUILD_DIR" -- "$@"
} }

Loading…
Cancel
Save