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",