From cccceabf8abeb612c973e0bd26d06cfc7bcefcc7 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 21 Mar 2024 13:04:45 -0700 Subject: [PATCH] exit flashing scripts with error if no pandas --- board/flash.py | 1 + board/jungle/flash.py | 2 ++ board/jungle/recover.py | 1 + board/recover.py | 1 + 4 files changed, 5 insertions(+) diff --git a/board/flash.py b/board/flash.py index d1a78e2c5..903a6a645 100755 --- a/board/flash.py +++ b/board/flash.py @@ -15,3 +15,4 @@ if __name__ == "__main__": print("flashing", s) with Panda(serial=s) as p: p.flash() + exit(1 if len(serials) == 0 else 0) diff --git a/board/jungle/flash.py b/board/jungle/flash.py index 75a7f0c8e..5b6c6e904 100755 --- a/board/jungle/flash.py +++ b/board/jungle/flash.py @@ -15,3 +15,5 @@ if __name__ == "__main__": print("flashing", s) with PandaJungle(serial=s) as p: p.flash() + + exit(1 if len(serials) == 0 else 0) diff --git a/board/jungle/recover.py b/board/jungle/recover.py index 98afb0674..19666c3ed 100755 --- a/board/jungle/recover.py +++ b/board/jungle/recover.py @@ -24,3 +24,4 @@ if __name__ == "__main__": for s in dfu_serials: print("flashing", s) PandaJungleDFU(s).recover() + exit(1 if len(dfu_serials) == 0 else 0) diff --git a/board/recover.py b/board/recover.py index 5284a4e29..0a248525a 100755 --- a/board/recover.py +++ b/board/recover.py @@ -24,3 +24,4 @@ if __name__ == "__main__": for s in dfu_serials: print("flashing", s) PandaDFU(s).recover() + exit(1 if len(dfu_serials) == 0 else 0)