From fd38a0e1dd3dbe0de365e938ac3dca3bee4320dd Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 9 Feb 2022 15:30:26 +0100 Subject: change file path format From now on we'll be using format 'file/sha256/' instead of 'file/sha256-'. --- src/hydrilla/builder/build.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/hydrilla') diff --git a/src/hydrilla/builder/build.py b/src/hydrilla/builder/build.py index 3503f7a..0044614 100644 --- a/src/hydrilla/builder/build.py +++ b/src/hydrilla/builder/build.py @@ -339,14 +339,13 @@ class Build: def write_package_files(self, dstpath: Path): """Write package files under 'dstpath' for distribution.""" - file_dir_path = (dstpath / 'file').resolve() + file_dir_path = (dstpath / 'file' / 'sha256').resolve() file_dir_path.mkdir(parents=True, exist_ok=True) for file_ref in self.files_by_path.values(): if file_ref.include_in_distribution: - file_name = f'sha256-{file_ref.contents_hash}' - with open(file_dir_path / file_name, 'wb') as output: - output.write(file_ref.contents) + file_path = file_dir_path / file_ref.contents_hash + file_path.write_bytes(file_ref.contents) source_dir_path = (dstpath / 'source').resolve() source_dir_path.mkdir(parents=True, exist_ok=True) -- cgit v1.2.3