From 01b273d9eedbf6f1fc50f135decca298cbb2b5ef Mon Sep 17 00:00:00 2001 From: Cookie987 Date: Mon, 14 Apr 2025 19:36:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=89=E8=A3=85=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9=E4=B8=80=E9=94=AE=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/run.sh | 71 +++++++++++++++++--------------------------------- 1 file changed, 24 insertions(+), 47 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index 342a23feb..ce604e4cb 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,10 +1,10 @@ #!/bin/bash -# MaiCore & Nonebot adapter一键安装脚本 by Cookie_987 +# MaiCore & NapCat Adapter一键安装脚本 by Cookie_987 # 适用于Arch/Ubuntu 24.10/Debian 12/CentOS 9 # 请小心使用任何一键脚本! -INSTALLER_VERSION="0.0.2-refactor" +INSTALLER_VERSION="0.0.3-refactor" LANG=C.UTF-8 # 如无法访问GitHub请修改此处镜像地址 @@ -31,7 +31,7 @@ DEFAULT_INSTALL_DIR="/opt/maicore" # 服务名称 SERVICE_NAME="maicore" SERVICE_NAME_WEB="maicore-web" -SERVICE_NAME_NBADAPTER="maicore-nonebot-adapter" +SERVICE_NAME_NBADAPTER="maibot-napcat-adapter" IS_INSTALL_MONGODB=false IS_INSTALL_NAPCAT=false @@ -59,9 +59,9 @@ show_menu() { "1" "启动MaiCore" \ "2" "停止MaiCore" \ "3" "重启MaiCore" \ - "4" "启动Nonebot adapter" \ - "5" "停止Nonebot adapter" \ - "6" "重启Nonebot adapter" \ + "4" "启动NapCat Adapter" \ + "5" "停止NapCat Adapter" \ + "6" "重启NapCat Adapter" \ "7" "拉取最新MaiCore仓库" \ "8" "切换分支" \ "9" "退出" 3>&1 1>&2 2>&3) @@ -83,15 +83,15 @@ show_menu() { ;; 4) systemctl start ${SERVICE_NAME_NBADAPTER} - whiptail --msgbox "✅Nonebot adapter已启动" 10 60 + whiptail --msgbox "✅NapCat Adapter已启动" 10 60 ;; 5) systemctl stop ${SERVICE_NAME_NBADAPTER} - whiptail --msgbox "🛑Nonebot adapter已停止" 10 60 + whiptail --msgbox "🛑NapCat Adapter已停止" 10 60 ;; 6) systemctl restart ${SERVICE_NAME_NBADAPTER} - whiptail --msgbox "🔄Nonebot adapter已重启" 10 60 + whiptail --msgbox "🔄NapCat Adapter已重启" 10 60 ;; 7) update_dependencies @@ -410,7 +410,7 @@ run_installation() { # 确认安装 confirm_install() { local confirm_msg="请确认以下更改:\n\n" - confirm_msg+="📂 安装MaiCore、Nonebot Adapter到: $INSTALL_DIR\n" + confirm_msg+="📂 安装MaiCore、NapCat Adapter到: $INSTALL_DIR\n" confirm_msg+="🔀 分支: $BRANCH\n" [[ $IS_INSTALL_DEPENDENCIES == true ]] && confirm_msg+="📦 安装依赖:${missing_packages[@]}\n" [[ $IS_INSTALL_MONGODB == true || $IS_INSTALL_NAPCAT == true ]] && confirm_msg+="📦 安装额外组件:\n" @@ -499,50 +499,28 @@ EOF } echo -e "${GREEN}克隆 nonebot-plugin-maibot-adapters 仓库...${RESET}" - git clone $GITHUB_REPO/MaiM-with-u/nonebot-plugin-maibot-adapters.git || { - echo -e "${RED}克隆 nonebot-plugin-maibot-adapters 仓库失败!${RESET}" + git clone $GITHUB_REPO/MaiM-with-u/MaiBot-Napcat-Adapter.git || { + echo -e "${RED}克隆 MaiBot-Napcat-Adapter.git 仓库失败!${RESET}" exit 1 } echo -e "${GREEN}安装Python依赖...${RESET}" pip install -r MaiBot/requirements.txt - pip install nb-cli - pip install nonebot-adapter-onebot - pip install 'nonebot2[fastapi]' + cd MaiBot + pip install uv + uv pip install -i https://mirrors.aliyun.com/pypi/simple -r requirements.txt + cd .. echo -e "${GREEN}安装maim_message依赖...${RESET}" cd maim_message - pip install -e . + uv pip install -i https://mirrors.aliyun.com/pypi/simple -e . cd .. - echo -e "${GREEN}部署Nonebot adapter...${RESET}" - cd MaiBot - mkdir nonebot-maibot-adapter - cd nonebot-maibot-adapter - cat > pyproject.toml < README.md - mkdir src - cp -r ../../nonebot-plugin-maibot-adapters/nonebot_plugin_maibot_adapters src/plugins/nonebot_plugin_maibot_adapters + echo -e "${GREEN}部署MaiBot Napcat Adapter...${RESET}" + cd MaiBot-Napcat-Adapter + uv pip install -i https://mirrors.aliyun.com/pypi/simple -r requirements.txt cd .. - cd .. - echo -e "${GREEN}同意协议...${RESET}" @@ -590,13 +568,13 @@ EOF cat > /etc/systemd/system/${SERVICE_NAME_NBADAPTER}.service < /etc/maicore_install.conf