diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2ccee5..0cf1602 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,10 +36,11 @@ jobs: artifact-*.txt README.md - - name: Add artifacts/artifact.txt + - name: Add artifacts/*.txt run: | mkdir artifacts echo "Build some tool and generate some artifacts" > artifacts/artifact.txt + touch artifacts/empty_file.txt - name: Single in subdir uses: ./ diff --git a/tip.py b/tip.py index 4f1324a..acd18ac 100755 --- a/tip.py +++ b/tip.py @@ -27,7 +27,11 @@ if len(args) == 0: for item in args: items = [fname for fname in glob(item, recursive=True) if not Path(fname).is_dir()] print("glob(%s)" % item, "->", items) - files = files + items + for fname in items: + if Path(fname).stat().st_size == 0: + print("! Skipping empty file %s" % fname) + continue + files += [fname] if len(files) < 1: stdout.flush()