diff --git a/flashall.py b/flashall.py index 22277fe..e7a1eaa 100644 --- a/flashall.py +++ b/flashall.py @@ -22,9 +22,23 @@ class color: print(color.RED + "\npreparing to flash rom, 5 seconds to abort..." + color.END) time.sleep(5) +print(color.PURPLE+"Checking if partitions are there..."+color.END) +time.sleep(1) + +missing = False +for partition in partitions: + if not os.path.exists(f"./{partition}.img"): + missing = True + print(color.RED+f"Missing partition {partition}"+ color.END) +if missing: + print(color.RED+f"due to the missing partitions you have 5 seconds to abort..."+ color.END) + time.sleep(5) +del missing + print(color.RED + "starting to flash rom...\n" + color.END) time.sleep(1) + for partition in partitions: if not os.path.exists(f"./{partition}.img"): print(color.BOLD + color.PURPLE + f"no {partition} to flash" + color.END)