diff --git a/src/wily/commands/build.py b/src/wily/commands/build.py index 02b5b3b3..4d5a23da 100644 --- a/src/wily/commands/build.py +++ b/src/wily/commands/build.py @@ -134,6 +134,8 @@ def build(config: WilyConfig, archiver: Archiver, operators: List[Operator]) -> # Copy the ir from any unchanged files from the prev revision if not seed: + # File names in result are platform dependent, so we convert + # to Path and back to str. files = {str(pathlib.Path(f)) for f in revision.tracked_files} missing_indices = files - indices # TODO: Check existence of file path. @@ -156,9 +158,13 @@ def build(config: WilyConfig, archiver: Archiver, operators: List[Operator]) -> for deleted in revision.deleted_files: result.pop(deleted, None) + # Add empty path for storing total aggregates + dirs = [""] + # Directory names in result are platform dependent, so we convert + # to Path and back to str. + dirs += [str(pathlib.Path(d)) for d in revision.tracked_dirs if d] # Aggregate metrics across all root paths using the aggregate function in the metric - # Note assumption is that nested dirs are listed after parent.. - dirs = {str(pathlib.Path(d)) for d in revision.tracked_dirs} + # Note assumption is that nested dirs are listed after parent, hence sorting. for root in sorted(dirs): # find all matching entries recursively aggregates = [