From fd59ec4b6cf6f024301a22aa421e535ee5ee08c9 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Thu, 11 May 2023 22:12:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=8C=87=E4=BB=A4clone=E6=8F=92=E4=BB=B6=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/command/command.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/model/command/command.py b/model/command/command.py index 8d90dba9d..151c97b65 100644 --- a/model/command/command.py +++ b/model/command/command.py @@ -66,7 +66,11 @@ class Command: return False, "未找到插件目录", "plugin" if l[1] == "i": try: - Repo.clone_from(l[2],to_path=ppath,branch='master') + # 得到url的最后一段 + d = l[2].split("/")[-1] + # 创建文件夹 + os.mkdir(os.path.join(ppath, d)) + Repo.clone_from(l[2],to_path=os.path.join(ppath, d),branch='master') return True, "插件拉取成功~", "plugin" except BaseException as e: return False, f"拉取插件失败,原因: {str(e)}", "plugin"