From 22e541e6f51c355f357d92538bfcf99be0fabec8 Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Fri, 29 Dec 2023 21:32:08 +0800 Subject: [PATCH] ci: forget to untar file Signed-off-by: Huaqi Fang <578567190@qq.com> --- .github/prepare_tools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/prepare_tools.py b/.github/prepare_tools.py index 86ac084..3dc5a37 100644 --- a/.github/prepare_tools.py +++ b/.github/prepare_tools.py @@ -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