Fix generator clean fail on .DS_Store

This commit is contained in:
legendecas 2022-05-02 22:56:46 +08:00 committed by Rick Waldron
parent d6b5b1358c
commit 2e7cdfbe18
1 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,11 @@ import glob, os, sys
from lib.expander import Expander
from lib.test import Test
# base name of the files to be ignored
ignored_files = [
'.DS_Store',
]
def print_error(*values):
print('ERROR:', *values, file=sys.stderr)
@ -35,6 +40,8 @@ def find_cases(location):
def clean(args):
for (subdir, _, fileNames) in os.walk(args.directory):
for fileName in map(lambda x: os.path.join(subdir, x), fileNames):
if os.path.basename(fileName) in ignored_files:
continue
test = Test(fileName)
test.load()
if test.is_generated():