From 2cad17b07bb48101e13eb0186fcaa1100e0ffe81 Mon Sep 17 00:00:00 2001 From: Florian Fleissner Date: Thu, 11 Apr 2019 14:51:35 +0200 Subject: [PATCH] Fixed Kaleidoscope Builder for Arduino paths containing whitespaces Signed-off-by: Florian Fleissner --- bin/kaleidoscope-builder | 4 ++-- etc/kaleidoscope-builder.conf | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index e4dcadce..83e100ca 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -261,12 +261,12 @@ compile () { # SC2091: We do not care if quotes or backslashes are not respected. # SC2086: We want word splitting. # shellcheck disable=SC2086,SC2090 - ${ARDUINO_BUILDER} \ + "${ARDUINO_BUILDER}" \ -compile \ ${ARDUINO_PACKAGES} \ -hardware "${ARDUINO_PATH}/hardware" \ -hardware "${BOARD_HARDWARE_PATH}" \ - ${ARDUINO_TOOLS_PARAM} \ + ${ARDUINO_TOOLS_FLAG:+"${ARDUINO_TOOLS_FLAG}"} ${ARDUINO_TOOLS_PARAM:+"${ARDUINO_TOOLS_PARAM}"} \ -tools "${ARDUINO_PATH}/tools-builder" \ -fqbn "${FQBN}" \ -libraries "." \ diff --git a/etc/kaleidoscope-builder.conf b/etc/kaleidoscope-builder.conf index dc69c04c..443ae80c 100644 --- a/etc/kaleidoscope-builder.conf +++ b/etc/kaleidoscope-builder.conf @@ -27,10 +27,10 @@ fi uname_S=$(uname -s 2>/dev/null || echo not) find_max_prog_size() { - VPIDS=$(${ARDUINO_BUILDER} \ + VPIDS=$("${ARDUINO_BUILDER}" \ -hardware "${ARDUINO_PATH}/hardware" \ -hardware "${BOARD_HARDWARE_PATH}" \ - ${ARDUINO_TOOLS_PARAM} \ + ${ARDUINO_TOOLS_FLAG:+"${ARDUINO_TOOLS_FLAG}"} ${ARDUINO_TOOLS_PARAM:+"${ARDUINO_TOOLS_PARAM}"} \ -tools "${ARDUINO_PATH}/tools-builder" \ -fqbn "${FQBN}" \ -dump-prefs | grep "upload\.maximum_size=") @@ -38,10 +38,10 @@ find_max_prog_size() { } find_device_vid_pid() { - VPIDS=$(${ARDUINO_BUILDER} \ + VPIDS=$("${ARDUINO_BUILDER}" \ -hardware "${ARDUINO_PATH}/hardware" \ -hardware "${BOARD_HARDWARE_PATH}" \ - ${ARDUINO_TOOLS_PARAM} \ + ${ARDUINO_TOOLS_FLAG:+"${ARDUINO_TOOLS_FLAG}"} ${ARDUINO_TOOLS_PARAM:+"${ARDUINO_TOOLS_PARAM}"} \ -tools "${ARDUINO_PATH}/tools-builder" \ -fqbn "${FQBN}" \ -dump-prefs | grep "\.[vp]id=") @@ -166,7 +166,8 @@ BOARD_HARDWARE_PATH="${BOARD_HARDWARE_PATH:-${ARDUINO_LOCAL_LIB_PATH}/hardware}" BOOTLOADER_PATH="${BOOTLOADER_PATH:-${BOARD_HARDWARE_PATH}/keyboardio/avr/bootloaders/caterina/Caterina.hex}" if [ ! -z "${ARDUINO_TOOLS_PATH}" ]; then - ARDUINO_TOOLS_PARAM="-tools ${ARDUINO_TOOLS_PATH}" + ARDUINO_TOOLS_PARAM="${ARDUINO_TOOLS_PATH}" + ARDUINO_TOOLS_FLAG="-tools" fi if [ ! -z "${AVR_GCC_PREFIX}" ]; then