image-minimizer: Check for missing root directory

This commit is contained in:
Brian C. Lane 2021-12-21 13:17:37 -08:00
parent f8af828a80
commit ab9068c2d0

View File

@ -145,9 +145,13 @@ class ImageMinimizer:
self.ts.run(runCallback, "erase") self.ts.run(runCallback, "erase")
def filter(self): def filter(self):
if not os.path.isdir(self.prefix):
raise FileNotFoundError(f"No such directory: '{self.prefix}")
with open(self.filename) as f: with open(self.filename) as f:
for line in f: for line in f:
self.parse_line(line.strip()) self.parse_line(line.strip())
self.remove() self.remove()
self.remove_rpm() self.remove_rpm()