Skip to content

Commit

Permalink
Fix Simplified Chinese tar file exists error
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyzz committed Sep 13, 2024
1 parent 27c6aaa commit f1e808d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/proficiency/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ def archive_files(file_paths: list[Path]) -> None:
_, lemma_code, gloss_code, _ = re.split(r"\.|_", path.name, 3)
grouped_paths[f"{lemma_code}_{gloss_code}"].append(path)
for tar_name, paths in grouped_paths.items():
if "zh_cn" in paths[-1].name:
tar_name += "_cn"
tar_path = f"build/{tar_name}.tar.bz2"
with tarfile.open(name=tar_path, mode="x:bz2") as tar_f:
for path in paths:
Expand Down

0 comments on commit f1e808d

Please sign in to comment.