Skip to content

Commit

Permalink
ci: forget to untar file
Browse files Browse the repository at this point in the history
Signed-off-by: Huaqi Fang <578567190@qq.com>
  • Loading branch information
fanghuaqi committed Dec 29, 2023
1 parent 3772d65 commit 22e541e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/prepare_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@ def download_and_extract(url, extract_folder, reuse=False):
print("Extracting %s to %s" % (file_name, extract_folder))
# Extract the contents
if file_name.endswith(".zip"):
print("Unzip {file_name}")
with zipfile.ZipFile(file_name, "r") as zip_ref:
zip_ref.extractall(extract_folder)
elif file_name.endswith(".tar.gz"):
elif file_name.endswith(".tar.gz") or file_name.endswith(".tgz"):
print("Untar {file_name}")
with tarfile.open(file_name, "r:gz") as tar_ref:
tar_ref.extractall(extract_folder)
else:
print("Unsupported archive file %s" % (file_name))

print("List in this directory %s: %s" %(extract_folder, os.listdir(extract_folder)))
# Remove the temporary file
Expand Down

0 comments on commit 22e541e

Please # to comment.