mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 03:10:32 +08:00
修改 docker 编译
This commit is contained in:
@@ -8,6 +8,6 @@ var (
|
||||
// APP_VER app版本号
|
||||
APP_VER = "0.0.1"
|
||||
// 提交id
|
||||
CommitId string
|
||||
Date string
|
||||
CommitId string
|
||||
BuildDate string
|
||||
)
|
||||
|
@@ -57,7 +57,7 @@ func execute() {
|
||||
envs[rr.Key().String()] = rr.Value().Index(0).String()
|
||||
}
|
||||
|
||||
//移动配置解析代码
|
||||
// 移动配置解析代码
|
||||
conf := linkViper.GetString("conf")
|
||||
linkViper.SetConfigFile(conf)
|
||||
err = linkViper.ReadInConfig()
|
||||
@@ -113,27 +113,27 @@ func initCmd() {
|
||||
cobra.OnInitialize(func() {
|
||||
linkViper.AutomaticEnv()
|
||||
|
||||
//ver := linkViper.GetBool("version")
|
||||
//if ver {
|
||||
// ver := linkViper.GetBool("version")
|
||||
// if ver {
|
||||
// printVersion()
|
||||
// os.Exit(0)
|
||||
//}
|
||||
// }
|
||||
//
|
||||
//return
|
||||
// return
|
||||
//
|
||||
//conf := linkViper.GetString("conf")
|
||||
//_, err := os.Stat(conf)
|
||||
//if errors.Is(err, os.ErrNotExist) {
|
||||
// conf := linkViper.GetString("conf")
|
||||
// _, err := os.Stat(conf)
|
||||
// if errors.Is(err, os.ErrNotExist) {
|
||||
// // 没有配置文件,不做处理
|
||||
// panic("conf stat err:" + err.Error())
|
||||
//}
|
||||
// }
|
||||
//
|
||||
//
|
||||
//linkViper.SetConfigFile(conf)
|
||||
//err = linkViper.ReadInConfig()
|
||||
//if err != nil {
|
||||
// linkViper.SetConfigFile(conf)
|
||||
// err = linkViper.ReadInConfig()
|
||||
// if err != nil {
|
||||
// panic("config file err:" + err.Error())
|
||||
//}
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -179,6 +179,6 @@ func initToolCmd() *cobra.Command {
|
||||
}
|
||||
|
||||
func printVersion() {
|
||||
fmt.Printf("%s v%s build on %s [%s, %s] %s commit_id(%s)\n",
|
||||
APP_NAME, APP_VER, runtime.Version(), runtime.GOOS, runtime.GOARCH, Date, CommitId)
|
||||
fmt.Printf("%s v%s build on %s [%s, %s] BuildDate:%s commit_id(%s)\n",
|
||||
APP_NAME, APP_VER, runtime.Version(), runtime.GOOS, runtime.GOARCH, BuildDate, CommitId)
|
||||
}
|
||||
|
@@ -21,16 +21,16 @@ var uiData embed.FS
|
||||
|
||||
// 程序版本
|
||||
var (
|
||||
appVer string
|
||||
commitId string
|
||||
date string
|
||||
appVer string
|
||||
commitId string
|
||||
buildDate string
|
||||
)
|
||||
|
||||
func main() {
|
||||
admin.UiData = uiData
|
||||
base.APP_VER = appVer
|
||||
base.CommitId = commitId
|
||||
base.Date = date
|
||||
base.BuildDate = buildDate
|
||||
|
||||
base.Start()
|
||||
handler.Start()
|
||||
|
Reference in New Issue
Block a user