From 8f61e632f16bb32a7899d3e61e1c6dd539628e5e Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Sun, 9 Feb 2025 15:01:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20Bash=20=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=A3=80=E6=9F=A5=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/utils/base.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/utils/base.sh b/bin/utils/base.sh index 51c7dfd..2baa3a5 100644 --- a/bin/utils/base.sh +++ b/bin/utils/base.sh @@ -41,4 +41,14 @@ check_jq(){ fi } +# 检查 Bash 是否已安装 +check_bash_installed() { + if command -v bash &> /dev/null; then + echo "Bash 已安装" + return 0 # 返回 0 表示 Bash 已安装 + else + echo "Bash 未安装" + return 1 # 返回 1 表示 Bash 未安装 + fi +}