From 010f4b466c3d30737599970adc499ad1722c7f27 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sun, 23 Feb 2020 22:40:32 -0800 Subject: [PATCH] Switch more of kaleidoscope-builder to use our new preferences loader --- etc/kaleidoscope-builder.conf | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/etc/kaleidoscope-builder.conf b/etc/kaleidoscope-builder.conf index 455051c8..bb34669a 100644 --- a/etc/kaleidoscope-builder.conf +++ b/etc/kaleidoscope-builder.conf @@ -45,17 +45,15 @@ uname_O=$(uname -o 2>/dev/null || echo not) find_max_prog_size() { -# https://github.com/arduino/arduino-builder/issues/341 - PREFS=$(dump_arduino_prefs | grep "upload\.maximum_size=") - MAX_PROG_SIZE=${MAX_PROG_SIZE:-$(echo "${PREFS}" | head -n 1 | cut -d= -f2)} + MAX_PROG_SIZE=${MAX_PROG_SIZE:-$(get_arduino_pref 'upload.maximum_size')} + } find_device_vid_pid() { - VPIDS=$(dump_arduino_prefs | grep "\.[vp]id=") - VID=${VID:-$(echo "${VPIDS}" | grep build.vid= | cut -dx -f2)} - SKETCH_PID=${SKETCH_PID:-$(echo "${VPIDS}" | grep build.pid= | cut -dx -f2)} - BOOTLOADER_PID=${BOOTLOADER_PID:-$(echo "${VPIDS}" | grep bootloader.pid= | cut -dx -f2)} - BOOTLOADER_VID=${BOOTLOADER_VID:-$(echo "${VPIDS}" | grep bootloader.vid= | cut -dx -f2)} + VID=${VID:-$(get_arduino_pref 'build.vid')} + SKETCH_PID=${SKETCH_PID:-$(get_arduino_pref 'build.pid')} + BOOTLOADER_PID=${BOOTLOADER_PID:-$(get_arduino_pref 'bootloader.pid')} + BOOTLOADER_VID=${BOOTLOADER_VID:-$(get_arduino_pref 'bootloader.vid')} } @@ -115,8 +113,7 @@ find_bootloader_ports() { } find_bootloader_path() { - BOOTLOADER_FILE=$( dump_arduino_prefs | grep "bootloader\.file=" | cut -d= -f2) - + BOOTLOADER_FILE=$( get_arduino_pref 'bootloader.file' ) BOOTLOADER_FILE="${BOOTLOADER_FILE:-caterina/Caterina.hex}" BOOTLOADER_PATH="${BOOTLOADER_PATH:-${BOARD_HARDWARE_PATH}/keyboardio/avr/bootloaders/${BOOTLOADER_FILE}}" }