From 83c7603f912e8fb7f80f1fecf35d544a2e675a0b Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 9 May 2025 20:45:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=89=93=E5=8C=85=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=BD=BF=E7=94=A8=E7=B3=BB=E7=BB=9FID?= =?UTF-8?q?=E5=8A=A0=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/build.sh b/build.sh index 6f77bc4..de47b46 100755 --- a/build.sh +++ b/build.sh @@ -24,25 +24,6 @@ echo "Version: $VERSION" # =================== -# 操作系统名称 -get_os_name() { - if [ -f /etc/os-release ]; then - . /etc/os-release - # 检查 $ID 是否为空 - if [ -z "$ID" ]; then - echo "ID is not defined in /etc/os-release" - exit 1 - fi - echo "$ID" - else - echo "unknown ID: /etc/os-release not found" - exit 1 - fi -} -# 获取当前操作系统名称 -OS_NAME=$(get_os_name) -echo "OS: $OS_NAME" - # 包管理器 get_manager() { if command -v rpm &> /dev/null; then @@ -76,6 +57,25 @@ get_arch() { PACKAGE_ARCH=$(get_arch) echo "Architecture: $PACKAGE_ARCH" +# 操作系统名称 +get_os_name() { + if [ -f /etc/os-release ]; then + . /etc/os-release + # 检查 $ID 是否为空 + if [ -z "$ID" ]; then + echo "ID is not defined in /etc/os-release" + exit 1 + fi + echo "$ID$VERSION_ID" + else + echo "unknown ID: /etc/os-release not found" + exit 1 + fi +} +# 获取当前操作系统名称 +OS_NAME=$(get_os_name) +echo "OS: $OS_NAME" + # =================== # 编译日期