From f15feb7fdfb261a0d672567c825d91d1bdc9170f Mon Sep 17 00:00:00 2001 From: MistEO Date: Fri, 24 May 2024 09:48:34 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=92=8C=E6=96=87=E6=A1=A3=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 +++++++------- configure.py | 7 +++++++ install.py | 7 +++++++ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 44ca03d..1546205 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ MaaFramework 实践模板。 git clone --recursive https://github.com/MaaXYZ/MaaPracticeBoilerplate.git ``` - **请注意,一定要完整克隆子项目,不要漏了 `--recursive`** + **请注意,一定要完整克隆子项目,不要漏了 `--recursive`,也不要下载 zip 包!** 2. 下载 MaaFramework 的 [Release 包](https://github.com/MaaXYZ/MaaFramework/releases),解压到 `deps` 文件夹中。 @@ -28,11 +28,11 @@ MaaFramework 实践模板。 - 也可以在本地安装后测试: 1. 执行安装脚本 - - ```bash - python ./install.py - ``` - + + ```bash + python ./install.py + ``` + 2. 运行 `install/MaaPiCli.exe` 5. 完成开发工作后,上传您的代码并发布版本。 @@ -51,7 +51,7 @@ MaaFramework 实践模板。 6. 发版您的版本 需要先修改仓库设置 `Settings` - `Actions` - `General` - `Read and write permissions` - `Save` - + ```bash # CI 检测到 tag 会自动进行发版 git tag v1.0.0 diff --git a/configure.py b/configure.py index 894d294..89af153 100644 --- a/configure.py +++ b/configure.py @@ -6,6 +6,11 @@ def configure_ocr_model(): + if not (assets_dir / "MaaCommonAssets" / "OCR").exists(): + print("Please clone this repository completely, don’t miss \"--recursive\", and don’t download the zip package!") + print("请完整克隆本仓库,不要漏掉 \"--recursive\",也不要下载 zip 包!") + exit(1) + shutil.copytree( assets_dir / "MaaCommonAssets" / "OCR" / "ppocr_v4" / "zh_cn", assets_dir / "resource" / "base" / "model" / "ocr", @@ -15,3 +20,5 @@ def configure_ocr_model(): if __name__ == "__main__": configure_ocr_model() + + print("OCR model configured.") \ No newline at end of file diff --git a/install.py b/install.py index 3c609b9..155c812 100644 --- a/install.py +++ b/install.py @@ -13,6 +13,11 @@ def install_deps(): + if not (working_dir / "deps" / "bin").exists(): + print("Please download the MaaFramework to \"deps\" first.") + print("请先下载 MaaFramework 到 \"deps\"。") + sys.exit(1) + shutil.copytree( working_dir / "deps" / "bin", install_path, @@ -69,3 +74,5 @@ def install_chores(): install_deps() install_resource() install_chores() + + print(f"Install to {install_path} successfully.") \ No newline at end of file