crate: exclude "target/" directory from %doc file search

This commit is contained in:
Fabio Valentini 2023-10-10 00:47:58 +02:00
parent 607ffb50e6
commit 8506b843c5
No known key found for this signature in database
GPG key ID: 5AC5F572E5D410AF

View file

@ -137,7 +137,9 @@ def get_doc_files(path: str) -> list[str]:
and not LICENSE_FILE_PATTERN.fullmatch(f)
and not DOC_FILE_EXCLUDES.fullmatch(f)
):
results.append(os.path.relpath(os.path.join(root, f), path))
relpath = os.path.relpath(os.path.join(root, f), path)
if not relpath.startswith("target/"):
results.append(relpath)
results.sort()
return results