fix(build): Docker 构建注入版本号并同步 aicodex 镜像脚本
This commit is contained in:
@@ -40,7 +40,12 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
// Read version from embedded VERSION file
|
||||
// 如果 Version 已通过 ldflags 注入(例如 -X main.Version=...),则不要覆盖。
|
||||
if strings.TrimSpace(Version) != "" {
|
||||
return
|
||||
}
|
||||
|
||||
// 默认从 embedded VERSION 文件读取版本号(编译期打包进二进制)。
|
||||
Version = strings.TrimSpace(embeddedVersion)
|
||||
if Version == "" {
|
||||
Version = "0.0.0-dev"
|
||||
|
||||
Reference in New Issue
Block a user