From df015ff663555cf9f68f1dd6e33f068d57c44e93 Mon Sep 17 00:00:00 2001 From: Cookie987 Date: Sat, 5 Apr 2025 13:44:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=AF=E6=8C=81dev=E5=88=86=E6=94=AF?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/run.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index c1fe4973f..342a23feb 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -4,7 +4,7 @@ # 适用于Arch/Ubuntu 24.10/Debian 12/CentOS 9 # 请小心使用任何一键脚本! -INSTALLER_VERSION="0.0.1-refactor" +INSTALLER_VERSION="0.0.2-refactor" LANG=C.UTF-8 # 如无法访问GitHub请修改此处镜像地址 @@ -62,7 +62,7 @@ show_menu() { "4" "启动Nonebot adapter" \ "5" "停止Nonebot adapter" \ "6" "重启Nonebot adapter" \ - "7" "更新MaiCore及其依赖" \ + "7" "拉取最新MaiCore仓库" \ "8" "切换分支" \ "9" "退出" 3>&1 1>&2 2>&3) @@ -111,6 +111,8 @@ show_menu() { # 更新依赖 update_dependencies() { + whiptail --title "⚠" --msgbox "更新后请阅读教程" 10 60 + systemctl stop ${SERVICE_NAME} cd "${INSTALL_DIR}/MaiBot" || { whiptail --msgbox "🚫 无法进入安装目录!" 10 60 return 1 @@ -126,8 +128,7 @@ update_dependencies() { return 1 fi deactivate - systemctl restart ${SERVICE_NAME} - whiptail --msgbox "✅ 依赖已更新并重启服务!" 10 60 + whiptail --msgbox "✅ 已停止服务并拉取最新仓库提交" 10 60 } # 切换分支 @@ -157,7 +158,7 @@ switch_branch() { whiptail --msgbox "🚫 代码拉取失败!" 10 60 return 1 fi - + systemctl stop ${SERVICE_NAME} source "${INSTALL_DIR}/venv/bin/activate" pip install -r requirements.txt deactivate @@ -165,8 +166,7 @@ switch_branch() { sed -i "s/^BRANCH=.*/BRANCH=${new_branch}/" /etc/maicore_install.conf BRANCH="${new_branch}" check_eula - systemctl restart ${SERVICE_NAME} - whiptail --msgbox "✅ 已切换到分支 ${new_branch} 并重启服务!" 10 60 + whiptail --msgbox "✅ 已停止服务并切换到分支 ${new_branch} !" 10 60 } check_eula() { @@ -228,6 +228,8 @@ run_installation() { fi fi + whiptail --title "ℹ️ 提示" --msgbox "如果您没有特殊需求,请优先使用docker方式部署。" 10 60 + # 协议确认 if ! (whiptail --title "ℹ️ [1/6] 使用协议" --yes-button "我同意" --no-button "我拒绝" --yesno "使用MaiCore及此脚本前请先阅读EULA协议及隐私协议\nhttps://github.com/MaiM-with-u/MaiBot/blob/refactor/EULA.md\nhttps://github.com/MaiM-with-u/MaiBot/blob/refactor/PRIVACY.md\n\n您是否同意上述协议?" 12 70); then exit 1 @@ -370,12 +372,13 @@ run_installation() { # 选择分支 choose_branch() { BRANCH=$(whiptail --title "🔀 选择分支" --radiolist "请选择要安装的分支:" 15 60 4 \ - "main" "稳定最新版(推荐)" ON \ - "classical" "经典版" OFF \ + "main" "稳定版本(推荐)" ON \ + "dev" "开发版(不知道什么意思就别选)" OFF \ + "classical" "经典版(0.6.0以前的版本)" OFF \ "custom" "自定义分支" OFF 3>&1 1>&2 2>&3) RETVAL=$? if [ $RETVAL -ne 0 ]; then - whiptail --msgbox "操作取消!" 10 60 + whiptail --msgbox "🚫 操作取消!" 10 60 exit 1 fi @@ -383,7 +386,7 @@ run_installation() { BRANCH=$(whiptail --title "🔀 自定义分支" --inputbox "请输入自定义分支名称:" 10 60 "refactor" 3>&1 1>&2 2>&3) RETVAL=$? if [ $RETVAL -ne 0 ]; then - whiptail --msgbox "输入取消!" 10 60 + whiptail --msgbox "🚫 输入取消!" 10 60 exit 1 fi if [[ -z "$BRANCH" ]]; then