summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--upload.sh4
1 files changed, 4 insertions, 0 deletions
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