Skip to content

Commit

Permalink
fix pack_directory_to_tar
Browse files Browse the repository at this point in the history
  • Loading branch information
grokhi committed Oct 11, 2023
1 parent 568b37d commit 36cfdad
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@ def pack_directory_to_tar(source_dir, output_tar):

with tarfile.open(output_tar, "w") as tar:
for root, _, files in os.walk(source_dir):
for file in tqdm(files, desc=f"Packing to '{output_tar}'", unit="file"):
file_path = os.path.join(root, file)
tar.add(file_path, arcname=os.path.relpath(file_path, source_dir))
with tqdm.tqdm(
desc=f"Unpacking '{output_tar}'",
total=len(files),
unit="file",
) as pbar:
for file in files:
file_path = os.path.join(root, file)
tar.add(file_path, arcname=os.path.relpath(file_path, source_dir))
pbar.update(1)


def ours_convert_json_info(self, info: dict, skip_missing=True):
Expand Down

0 comments on commit 36cfdad

Please sign in to comment.