mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 19:16:57 +08:00
skip empty files (#159)
This commit is contained in:
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
@@ -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: ./
|
||||
|
||||
6
tip.py
6
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()
|
||||
|
||||
Reference in New Issue
Block a user