Skip to content

Commit e3cb570

Browse files
committed
Check if IDE is installed before attempting to use Boards Manager or Library Manager
This will provide a useful error message as to the cause of the failure.
1 parent 30f5b89 commit e3cb570

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

arduino-ci-script.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,12 @@ function install_package()
442442
local -r packageID="$1"
443443
local -r packageURL="$2"
444444

445+
# Check if Arduino IDE is installed
446+
if [[ "$INSTALLED_IDE_VERSION_LIST_ARRAY" == "" ]]; then
447+
echo "ERROR: Installing a hardware package via Boards Manager requires the Arduino IDE to be installed. Please call install_ide before this command."
448+
return "$ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS"
449+
fi
450+
445451
# Check if the newest installed IDE version supports --install-boards
446452
local -r unsupportedInstallBoardsOptionVersionsRange1regex="1.5.[0-9]"
447453
local -r unsupportedInstallBoardsOptionVersionsRange2regex="1.6.[0-3]"
@@ -531,6 +537,13 @@ function install_library()
531537

532538
else
533539
# Install a library that is part of the Library Manager index
540+
541+
# Check if Arduino IDE is installed
542+
if [[ "$INSTALLED_IDE_VERSION_LIST_ARRAY" == "" ]]; then
543+
echo "ERROR: Installing a library via Library Manager requires the Arduino IDE to be installed. Please call install_ide before this command."
544+
return "$ARDUINO_CI_SCRIPT_FAILURE_EXIT_STATUS"
545+
fi
546+
534547
# Check if the newest installed IDE version supports --install-library
535548
local -r unsupportedInstallLibraryOptionVersionsRange1regex="1.5.[0-9]"
536549
local -r unsupportedInstallLibraryOptionVersionsRange2regex="1.6.[0-3]"

0 commit comments

Comments
 (0)