From 76ce429aa92af412d405d54e1ceae384c22ca64e Mon Sep 17 00:00:00 2001 From: ff m Date: Tue, 29 Aug 2023 02:15:44 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E6=9B=B4=E6=96=B0=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=20=E8=87=AA=E5=8A=A8=E6=A3=80=E6=B5=8B=20jq=20?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E4=BE=9D=E8=B5=96=E5=AE=89=E8=A3=85=20?= =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E4=BB=A4=E7=89=8C=E4=B8=8B?= =?UTF-8?q?=E7=A7=BB=E5=88=A4=E6=96=AD=20Count=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/linux/install.sh | 28 +++++++++++++++++++ ref/WinAuth | 2 +- .../AuthenticatorHomePageViewModel.cs | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/build/linux/install.sh b/build/linux/install.sh index 8af1bccf6..74fc7d6bc 100644 --- a/build/linux/install.sh +++ b/build/linux/install.sh @@ -40,6 +40,33 @@ Install_certutil() { echo "certutil 工具已安装。" fi } +Install_jq() { + # Check if jq is already installed + if command -v jq &>/dev/null; then + echo "jq 工具已安装。" + else + echo "jq 用来解析版本更新。" + # Check the package manager + if command -v apt &>/dev/null; then + # Using apt (Debian/Ubuntu) + sudo apt update + sudo apt install -y jq + elif command -v dnf &>/dev/null; then + # Using dnf (Fedora) + sudo dnf install -y jq + elif command -v yum &>/dev/null; then + # Using yum (CentOS/Red Hat) + sudo yum install -y jq + elif command -v pacman &>/dev/null; then + # Using pacman (Arch Linux) + sudo pacman -S jq + else + echo "请手动安装 jq 工具。" + exit 1 + fi + echo "请手动安装 jq 工具。" + fi +} #精简版系统可能没有该工具 Install_zenity() { # 判断发行版类型 @@ -266,6 +293,7 @@ exit" >"$base_path/$exec_name.sh" #先安装依赖; Install_certutil Install_zenity +Install_jq #版本检查更新; Get_NewVer diff --git a/ref/WinAuth b/ref/WinAuth index 31e7e4a02..e936bae0c 160000 --- a/ref/WinAuth +++ b/ref/WinAuth @@ -1 +1 @@ -Subproject commit 31e7e4a02fdf5144962f5114443e5325a4e51453 +Subproject commit e936bae0c967ffb04de0cda30ebf7723ead55fc4 diff --git a/src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorHomePageViewModel.cs b/src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorHomePageViewModel.cs index 10710f165..f85e7fc62 100644 --- a/src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorHomePageViewModel.cs +++ b/src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorHomePageViewModel.cs @@ -563,7 +563,7 @@ public sealed partial class AuthenticatorHomePageViewModel : ViewModelBase { if (sender is not AuthenticatorItemModel authenticatorItemModel) return; var index = Auths.IndexOf(authenticatorItemModel); - if (index == Auths.Count) + if (index > Auths.Count) return; if (authenticatorItemModel.AuthData.ServerId != null) {