From 912118e3c1dfc0e36af29962125fc91d2f841fa8 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sat, 17 Oct 2020 21:33:22 -0700 Subject: [PATCH] Start to be able to use the system arduino cli --- bin/kaleidoscope-builder | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 7d5ed1a6..f8a8e39c 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -683,7 +683,18 @@ fi # shellcheck disable=SC2034 : "${KALEIDOSCOPE_BIN_DIR:=${KALEIDOSCOPE_DIR}/bin/}" -: "${ARDUINO_CLI:=${KALEIDOSCOPE_BIN_DIR}/arduino-cli}" + +SYSTEM_ARDUINO_CLI="$(which arduino-cli || true )" + +if [ "x${SYSTEM_ARDUINO_CLI}" == "x" ]; then + $VERBOSE && echo "Using our own arduino-cli" + : "${ARDUINO_CLI:=${KALEIDOSCOPE_BIN_DIR}/arduino-cli}" +else + $VERBOSE && echo "Using system arduino-cli from ${SYSTEM_ARDUINO_CLI}" + : "${ARDUINO_CLI:=${SYSTEM_ARDUINO_CLI}}" +fi + + : "${ARDUINO_CONTENT:=${KALEIDOSCOPE_DIR}/.arduino}" : "${ARDUINO_DIRECTORIES_DATA:=${ARDUINO_CONTENT}/data}"