Skip to content

Commit

Permalink
improve listing of glob results
Browse files Browse the repository at this point in the history
  • Loading branch information
eine committed Oct 18, 2021
1 parent 02db3d0 commit fb0c52c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tip.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@

for item in args:
items = [fname for fname in glob(item, recursive=True) if not Path(fname).is_dir()]
print(f"glob({item!s})", "->", items)
print(f" glob({item!s}):")
for fname in items:
if Path(fname).stat().st_size == 0:
print(f"! Skipping empty file {fname!s}")
print(f" - ! Skipping empty file {fname!s}")
continue
print(f" - {fname!s}")
files += [fname]

if len(files) < 1:
Expand Down

0 comments on commit fb0c52c

Please sign in to comment.