From b5e63e114e10b3e49bca0d7ae9c455c8cd90067c Mon Sep 17 00:00:00 2001 From: Cookie987 Date: Wed, 2 Apr 2025 17:09:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8D=A2=E6=8E=89=E4=B8=80=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E7=9A=84=E7=A5=9E=E4=BA=BA=E5=A4=9A=E5=8F=91=E8=A1=8C?= =?UTF-8?q?=E7=89=88=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit by @sourcery-ai Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- run.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/run.sh b/run.sh index dc2ae2b56..1f7fba1ce 100644 --- a/run.sh +++ b/run.sh @@ -216,13 +216,16 @@ run_installation() { if ! command -v whiptail &>/dev/null; then echo -e "${RED}[1/6] whiptail 未安装,正在安装...${RESET}" - # 这里的多系统适配很神人,但是能用() - - apt update && apt install -y whiptail - - pacman -S --noconfirm libnewt - - yum install -y newt + if command -v apt-get &>/dev/null; then + apt-get update && apt-get install -y whiptail + elif command -v pacman &>/dev/null; then + pacman -Syu --noconfirm whiptail + elif command -v yum &>/dev/null; then + yum install -y whiptail + else + echo -e "${RED}[Error] 无受支持的包管理器,无法安装 whiptail!${RESET}" + exit 1 + fi fi # 协议确认