You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deal with pollution of the --get-pref output introduced in Arduino IDE 1.8.10
arduino/Arduino#9023 changed the Arduino IDE CLI's output. Due to this, when no boardsmanager.additional.urls preference is set, the output from Arduino IDE 1.8.10 (and onwards likely) caused priorBoardsmanagerAdditionalURLs to be set to "Set log4j store directory /home/travis/.arduino15". The solution was to check the exit status of the arduino --get-pref command and if it is 4 (Preference passed to --get-pref does not exist), overwrite the spurious value.
priorBoardsmanagerAdditionalURLs=$("${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER}/${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER}/${ARDUINO_CI_SCRIPT_ARDUINO_COMMAND}" --get-pref boardsmanager.additional.urls | tee /dev/tty | tail --lines=1)
553
+
priorBoardsmanagerAdditionalURLs=$(
554
+
"${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER}/${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER}/${ARDUINO_CI_SCRIPT_ARDUINO_COMMAND}" --get-pref boardsmanager.additional.urls | tee /dev/tty | tail --lines=1
555
+
exit"${PIPESTATUS[0]}"
556
+
)
557
+
getPrefExitStatus="$?"
543
558
fi
559
+
set -o errexit
560
+
561
+
if [[ "$getPrefExitStatus" == "4" ]]; then
562
+
# No boardsmanager.additional.urls preference was set. This causes priorBoardsmanagerAdditionalURLs to have a garbage value with Arduino IDE 1.8.10 and newer.
563
+
priorBoardsmanagerAdditionalURLs=""
564
+
fi
565
+
544
566
local -r blankregex="^[ ]*$"
545
567
if [[ "$priorBoardsmanagerAdditionalURLs" =~ $blankregex ]]; then
546
568
# There is no previous Additional Boards Manager URLs preference value
0 commit comments