调整安装脚本 by opencode

This commit is contained in:
2026-02-22 20:09:40 +08:00
parent 5147f76336
commit fd373d10c8

View File

@ -57,14 +57,12 @@ detect_arch() {
# 获取最新版本
get_latest_version() {
print_info "获取最新版本信息..."
local version=$(curl -s "${GITEA_REPO}/releases" | grep -oP 'releases/tag/v\K[0-9.]+' | head -1)
if [ -z "$version" ]; then
print_warn "无法自动获取版本,使用默认版本 0.1.0"
echo "0.1.0"
else
echo "$version"
version="0.1.0"
print_warn "无法自动获取版本,使用默认版本 ${version}" >&2
fi
echo "$version"
}
# 下载二进制文件
@ -239,6 +237,7 @@ main() {
print_info "检测到系统架构: ${ARCH}"
# 获取版本
print_info "获取最新版本信息..."
VERSION=$(get_latest_version)
print_info "使用版本: v${VERSION}"