From 84576b10d4a0b2a27b3cc69826a94d465e9b5071 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sat, 14 Nov 2020 18:39:24 -0800 Subject: [PATCH] Move setting ARDUINO_CLI to the makefile --- bin/kaleidoscope-builder | 11 ----------- etc/sketch-arduino-cli.mk | 7 ++++++- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index aee5fbb2..81d4fb53 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -32,16 +32,6 @@ _read_conf_files() { done } -_configure_arduino_cli_env() { - system_arduino_cli="$(command -v arduino-cli || true)" - - if [ -z "${system_arduino_cli}" ]; then - : "${ARDUINO_CLI:=${KALEIDOSCOPE_BIN_DIR}/arduino-cli}" - else - : "${ARDUINO_CLI:=${system_arduino_cli}}" - fi - -} cmd_configure_arduino_cli() { if [ -z "${ARDUINO_CLI}" ]; then @@ -344,7 +334,6 @@ if [ $# -lt 1 ]; then fi _read_conf_files -_configure_arduino_cli_env # shellcheck disable=SC1090 diff --git a/etc/sketch-arduino-cli.mk b/etc/sketch-arduino-cli.mk index c078d530..8069da2c 100644 --- a/etc/sketch-arduino-cli.mk +++ b/etc/sketch-arduino-cli.mk @@ -11,8 +11,13 @@ export ARDUINO_DIRECTORIES_USER ?= $(ARDUINO_CONTENT)/user export ARDUINO_CLI_CONFIG ?= $(ARDUINO_DIRECTORIES_DATA)/arduino-cli.yaml export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS ?= https://raw.githubusercontent.com/keyboardio/boardsmanager/master/package_keyboardio_index.json +system_arduino_cli=$(command -v arduino-cli || true) - +ifeq ($(system_arduino_cli),) +export ARDUINO_CLI ?= $(KALEIDOSCOPE_BIN_DIR)/arduino-cli +else +export ARDUINO_CLI ?= $(system_arduino_cli) +endif .DEFAULT_GOAL := compile