Improve frozen prep to skip example subdirectories

This commit is contained in:
Scott Shawcroft 2019-09-30 13:37:51 -07:00
parent 8048dcb76c
commit c12c837abd
No known key found for this signature in database
GPG Key ID: 9349BC7E64B1921E

View File

@ -32,8 +32,9 @@ def version_string(path=None, *, valid_semver=False):
def copy_and_process(in_dir, out_dir): def copy_and_process(in_dir, out_dir):
for root, subdirs, files in os.walk(in_dir): for root, subdirs, files in os.walk(in_dir):
# Skip library examples directories. # Skip library examples directory and subfolders.
if Path(root).name in ['examples', 'docs', 'tests']: relative_path_parts = Path(root).relative_to(in_dir).parts
if relative_path_parts and relative_path_parts[0] in ['examples', 'docs', 'tests']:
continue continue
for file in files: for file in files: