mask tool: log and exit if batch not using folder

This commit is contained in:
torzdf 2023-06-30 09:42:52 +01:00
parent 4e7e5fe308
commit 8fb96b0d6e

View File

@ -59,6 +59,10 @@ class Mask(): # pylint:disable=too-few-public-methods
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))