Skip to content

Commit

Permalink
mask tool: log and exit if batch not using folder
Browse files Browse the repository at this point in the history
  • Loading branch information
torzdf committed Jun 30, 2023
1 parent 4e7e5fe commit 8fb96b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/mask/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def _get_input_locations(self) -> list[str]:
if not self._args.batch_mode:
return [self._args.input]

if not os.path.isdir(self._args.input):
logger.error("Batch mode is selected but input '%s' is not a folder", self._args.input)
sys.exit(1)

retval = [os.path.join(self._args.input, fname)
for fname in os.listdir(self._args.input)
if os.path.isdir(os.path.join(self._args.input, fname))
Expand Down

0 comments on commit 8fb96b0

Please sign in to comment.