From d88962eb562498f28e9c5036547386ff59b95657 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 30 Nov 2022 13:21:28 +0800 Subject: [PATCH] =?UTF-8?q?gitea=E5=8D=B8=E8=BD=BD=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/gitea/index.py | 11 +++++++++++ plugins/gitea/info.json | 2 ++ 2 files changed, 13 insertions(+) diff --git a/plugins/gitea/index.py b/plugins/gitea/index.py index d8fbd7251..2dfa2348e 100755 --- a/plugins/gitea/index.py +++ b/plugins/gitea/index.py @@ -697,6 +697,15 @@ def getTotalStatistics(): return mw.returnJson(False, 'fail', data) +def uninstallPreInspection(): + repo_dir = getServerDir() + "/data/gitea-repositories" + if not os.path.exists(repo_dir): + return 'ok' + dir_list = os.listdir(repo_dir) + if len(dir_list) > 0: + return "有项目!请手动删除Gitea
rm -rf {}".format(getServerDir()) + return 'ok' + if __name__ == "__main__": func = sys.argv[1] if func == 'status': @@ -715,6 +724,8 @@ if __name__ == "__main__": print(initdInstall()) elif func == 'initd_uninstall': print(initdUinstall()) + elif func == 'uninstall_pre_inspection': + print(uninstallPreInspection()) elif func == 'run_log': print(runLog()) elif func == 'post_receive_log': diff --git a/plugins/gitea/info.json b/plugins/gitea/info.json index 2eac70638..15604a4a4 100755 --- a/plugins/gitea/info.json +++ b/plugins/gitea/info.json @@ -4,6 +4,8 @@ "title": "Gitea", "versions": ["1.17.2"], "tip": "soft", + "install_pre_inspection":false, + "uninstall_pre_inspection":true, "checks": "server/gitea", "path":"server/gitea", "author": "gitea",