From 3b2c796b07e8304ea4047c656d362a52ac3e7388 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Mon, 10 Jun 2024 23:44:02 +0100 Subject: added failsafe if board detection fails --- upload.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/upload.sh b/upload.sh index b74e057..4d7589c 100644 --- a/upload.sh +++ b/upload.sh @@ -1,4 +1,8 @@ BOARD="arduino:avr:uno" PORT=$(arduino-cli board list | grep dev | grep -o '^\S*') +if [ -z $PORT ]; +then + return "Failed to find board" +fi arduino-cli compile -b $BOARD arduino-cli upload -p $PORT -b $BOARD -- cgit v1.2.3-70-g09d2