From 0817c3f148599719c06dc8106263d1f5104e6e53 Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Thu, 6 Apr 2023 10:08:15 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=B0=86=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E7=A7=BB=E5=8A=A8=E5=88=B0res/scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/update-cmdpriv-template.yml | 6 +++++- .github/workflows/update-override-all.yml | 4 ++++ .../scripts/generate_cmdpriv_template.py | 2 +- .../scripts/generate_override_all.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) rename generate_cmdpriv_template.py => res/scripts/generate_cmdpriv_template.py (92%) rename generate_override_all.py => res/scripts/generate_override_all.py (91%) diff --git a/.github/workflows/update-cmdpriv-template.yml b/.github/workflows/update-cmdpriv-template.yml index 8d8db1f8..dde400e7 100644 --- a/.github/workflows/update-cmdpriv-template.yml +++ b/.github/workflows/update-cmdpriv-template.yml @@ -27,7 +27,11 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install --upgrade yiri-mirai openai colorlog func_timeout dulwich Pillow - + + - name: Copy Scripts + run: | + cp res/scripts/generate_cmdpriv_template.py . + - name: Generate Files run: | python main.py diff --git a/.github/workflows/update-override-all.yml b/.github/workflows/update-override-all.yml index 850186c4..ec3efdbb 100644 --- a/.github/workflows/update-override-all.yml +++ b/.github/workflows/update-override-all.yml @@ -31,6 +31,10 @@ jobs: python -m pip install --upgrade pip # 在此处添加您的项目所需的其他依赖 + - name: Copy Scripts + run: | + cp res/scripts/generate_override_all.py . + - name: Run generate_override_all.py run: python3 generate_override_all.py diff --git a/generate_cmdpriv_template.py b/res/scripts/generate_cmdpriv_template.py similarity index 92% rename from generate_cmdpriv_template.py rename to res/scripts/generate_cmdpriv_template.py index 9b2d35af..45ff0b39 100644 --- a/generate_cmdpriv_template.py +++ b/res/scripts/generate_cmdpriv_template.py @@ -13,5 +13,5 @@ for key in cmdsmgr.__command_list__: template[key] = cmdsmgr.__command_list__[key]['privilege'] # 写入cmdpriv-template.json -with open('cmdpriv-template.json', 'w') as f: +with open('../../cmdpriv-template.json', 'w') as f: f.write(json.dumps(template, indent=4, ensure_ascii=False)) \ No newline at end of file diff --git a/generate_override_all.py b/res/scripts/generate_override_all.py similarity index 91% rename from generate_override_all.py rename to res/scripts/generate_override_all.py index 69674c38..cff27e02 100644 --- a/generate_override_all.py +++ b/res/scripts/generate_override_all.py @@ -19,5 +19,5 @@ for k, v in template.__dict__.items(): print(k, v, type(v)) output_json[k] = v -with open("override-all.json", "w", encoding="utf-8") as f: +with open("../../override-all.json", "w", encoding="utf-8") as f: json.dump(output_json, f, indent=4, ensure_ascii=False)