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}"