From cfdc52cedb6ac8299e49d19402ee77fa26b2f669 Mon Sep 17 00:00:00 2001 From: Miku <26039249+xMikux@users.noreply.github.com> Date: Sat, 2 Sep 2023 23:07:00 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=9B=B4=E6=96=B0=E5=8B=95=E6=85=8B=20FP?= =?UTF-8?q?S=20=E7=9A=84=E8=A6=86=E8=93=8B=20(#360)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2.4.0 已包含繁體翻譯 (1.20) 但 1.19 以下沒有,所以將此翻譯移動至 1.19 特定 --- .github/configs/override_list.json | 6 +++--- .github/scripts/override_script.py | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/configs/override_list.json b/.github/configs/override_list.json index 27a461fa8..9dc7754d9 100644 --- a/.github/configs/override_list.json +++ b/.github/configs/override_list.json @@ -164,10 +164,10 @@ }, { "modName": "Dynamic FPS", - "modLoader": "Forge", - "modVersion": "main", + "modLoader": "Fabric", + "modVersion": "1.19", "licenseURL": "https://raw.githubusercontent.com/juliand665/Dynamic-FPS/main/LICENSE", - "url": "https://raw.githubusercontent.com/juliand665/Dynamic-FPS/main/src/main/resources/assets/dynamicfps/lang/zh_tw.json" + "url": "https://raw.githubusercontent.com/juliand665/Dynamic-FPS/2.4.0/src/main/resources/assets/dynamicfps/lang/zh_tw.json" }, { "modName": "CoFHCore", diff --git a/.github/scripts/override_script.py b/.github/scripts/override_script.py index 2894e9bbb..a28ac9d23 100644 --- a/.github/scripts/override_script.py +++ b/.github/scripts/override_script.py @@ -165,6 +165,7 @@ def zip_copyer(temp_dir, modloader, version): except OSError as e: print(f"Error occurred while copying file: {e}") +# TODO Make this better def zip_copyer_all(temp_dir, modloader, version): source_path = os.path.join(temp_dir, "assets") dest_path = Path("MultiVersions", modloader, version) @@ -178,6 +179,19 @@ def zip_copyer_all(temp_dir, modloader, version): except OSError as e: print(f"Error occurred while copying file: {e}") +def zip_copyer_all_temp(temp_dir): + source_path = os.path.join(temp_dir, "MultiVersions") + dest_path = Path("MultiVersions") + + print("> 模組 ID 複製全部(暫時)") + print("> 原始路徑", source_path) + print("> 目的路徑", dest_path) + + try: + shutil.copytree(source_path, dest_path, dirs_exist_ok=True) + except OSError as e: + print(f"Error occurred while copying file: {e}") + def zip_extract(modname, modloader, version, url, extractAll: bool): temp_dir = tempfile.mkdtemp() override_file = os.path.join(temp_dir, os.path.basename(url)) @@ -190,7 +204,10 @@ def zip_extract(modname, modloader, version, url, extractAll: bool): zip.extractall(temp_dir) if extractAll: - zip_copyer_all(temp_dir, modloader, version) + if os.path.exists(os.path.join(temp_dir, "MultiVersions")): + zip_copyer_all_temp(temp_dir) + else: + zip_copyer_all(temp_dir, modloader, version) else: zip_copyer(temp_dir, modloader, version)