1
0

feat: 打包文件名称使用系统ID加版本号

This commit is contained in:
TsMask
2025-05-09 20:45:30 +08:00
parent 1c96e28f38
commit 83c7603f91

View File

@@ -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"
# ===================
# 编译日期