feat: 打包文件名称使用系统ID加版本号
This commit is contained in:
38
build.sh
38
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"
|
||||
|
||||
# ===================
|
||||
|
||||
# 编译日期
|
||||
|
||||
Reference in New Issue
Block a user