提交 6fcc6c9a 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

upgrade

上级 f01acf54
Version = 1
Version = 1.6
Language = zh
......@@ -164,6 +164,52 @@
{
"id": "fail_to_exec_cmd",
"translation": "Fail to exec command '%s', error is '%s'."
},
{
"id": "find_new_ver",
"translation": "Find new version %s"
},
{
"id": "success_upgrade",
"translation": "Successfully upgrade from version %.1f to %s."
},
{
"id": "fail_upgrade",
"translation": "Fail to upgrade from version %.1f to %s., err: %s."
},
{
"id": "download_fail",
"translation": "Download %s fail, error: %s."
},
{
"id": "download_read_fail",
"translation": "Read download file %s fail, error: %s."
},
{
"id": "download_write_fail",
"translation": "Write download file %s fail, error: %s."
},
{
"id": "download_success",
"translation": "Successfully download %s to %s."
},
{
"id": "success_update_config",
"translation": "Successfully update config file %s."
},
{
"id": "perm_deny",
"translation": "Permission denied to file %s, please change work dir."
},
{
"id": "fail_unzip",
"translation": "Fail to unzip file %s."
},
{
"id": "fail_md5_check",
"translation": "Check file %s MD5 failed."
}
]
}
......@@ -155,6 +155,52 @@
{
"id": "fail_to_exec_cmd",
"translation": "执行命令'%s'失败,错误消息为'%s'。"
},
{
"id": "find_new_ver",
"translation": "发现新版本%s。"
},
{
"id": "success_upgrade",
"translation": "成功从版本%.1f升级到%s。"
},
{
"id": "fail_upgrade",
"translation": "失败升级版本从%.1f到%s,错误 %s。"
},
{
"id": "download_fail",
"translation": "下载文件失败 %s,错误 %s。"
},
{
"id": "download_read_fail",
"translation": "读取下载文件%s失败,错误 %s。"
},
{
"id": "download_write_fail",
"translation": "写入下载文件%s失败,错误 %s。"
},
{
"id": "download_success",
"translation": "成功下载文件%s到%s。"
},
{
"id": "success_update_config",
"translation": "成功更新配置文件%s。"
},
{
"id": "perm_deny",
"translation": "文件%s权限不足,建议切换工作目录。"
},
{
"id": "fail_unzip",
"translation": "解压文件%s失败。"
},
{
"id": "fail_md5_check",
"translation": "验证文件%s的MD5失败。"
}
]
}
......@@ -57,7 +57,9 @@ func InitConfig() {
func SaveConfig(conf model.Config) error {
fileUtils.MkDirIfNeeded(filepath.Dir(vari.ConfigFile))
conf.Version = constant.ConfigVer
if conf.Version == 0 {
conf.Version = constant.ConfigVer
}
cfg := ini.Empty()
cfg.ReflectFrom(&conf)
......@@ -131,6 +133,7 @@ func CheckConfigPermission() {
func CheckConfigReady() {
if !fileUtils.FileExist(vari.ConfigFile) {
logUtils.PrintTo(vari.ConfigFile + "no exist")
if vari.RunMode == constant.RunModeServer {
conf := model.Config{Language: "zh", Version: 1}
SaveConfig(conf)
......
......@@ -7,7 +7,7 @@ import (
)
const (
AppName = "ztf"
AppName = "zendata"
)
var (
......
......@@ -342,6 +342,7 @@ func InitServer() (err error) {
upgradeService := serverService.NewUpgradeService()
cronService := serverService.NewCronService(upgradeService)
cronService.Init()
server := NewServer(config, defService, fieldService, sectionService, referService,
rangesService, instancesService, textService, excelService, configService, resService,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册