feat(patch): upgrade patch module (#7738)
* feat(patch): upgrade patch module * chore(patch): add docs * fix(patch): skip and rewrite invalid last launched version * fix(patch): turn two functions into patches
This commit is contained in:
@ -34,6 +34,8 @@ func InitConfig() {
|
||||
log.Fatalf("failed to create config file: %+v", err)
|
||||
}
|
||||
conf.Conf = conf.DefaultConfig()
|
||||
LastLaunchedVersion = conf.Version
|
||||
conf.Conf.LastLaunchedVersion = conf.Version
|
||||
if !utils.WriteJsonToFile(configPath, conf.Conf) {
|
||||
log.Fatalf("failed to create default config file")
|
||||
}
|
||||
@ -47,6 +49,10 @@ func InitConfig() {
|
||||
if err != nil {
|
||||
log.Fatalf("load config error: %+v", err)
|
||||
}
|
||||
LastLaunchedVersion = conf.Conf.LastLaunchedVersion
|
||||
if conf.Version != "dev" || LastLaunchedVersion == "" {
|
||||
conf.Conf.LastLaunchedVersion = conf.Version
|
||||
}
|
||||
// update config.json struct
|
||||
confBody, err := utils.Json.MarshalIndent(conf.Conf, "", " ")
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user