Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/quack/utils/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import glob
import hashlib
import os
import shutil
Expand All @@ -22,7 +23,13 @@ def archive(paths: Iterable[str], archive_path: str) -> None:
try:
with tarfile.open(tmp_tar_path, "w") as tar:
for path in paths:
tar.add(path, arcname=path)
# 展开通配符
matches = glob.glob(path)
if not matches:
raise FileNotFoundError(f"未找到匹配的文件:{path}")

for matched_path in matches:
tar.add(matched_path, arcname=matched_path)

with open(tmp_tar_path, "rb") as f_in:
tar_data = f_in.read()
Expand Down