process-text-files.py: Make it usable again

This --maxdepth / --name patch introduced broke run(). This commit
fixes that.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-12-25 11:44:48 +01:00
commit 350c2147dd

View file

@ -381,7 +381,7 @@ class Cmd(jwutils.Cmd):
if regex is not None: if regex is not None:
for entry in _scantree(args.root, args.maxdepth): for entry in _scantree(args.root, args.maxdepth):
if re.search(regex, entry.name): if re.search(regex, entry.name):
root = os.dirname(entry.path) root = os.path.dirname(entry.path)
if not root: if not root:
root = '.' root = '.'
files.append((root, entry.path)) files.append((root, entry.path))