Feat: execute database script to calibrate user storage

This commit is contained in:
HFO4
2020-12-06 16:49:49 +08:00
parent 6486e8799b
commit f7c8039116
5 changed files with 91 additions and 3 deletions

12
main.go
View File

@@ -10,13 +10,15 @@ import (
)
var (
isEject bool
confPath string
isEject bool
confPath string
scriptName string
)
func init() {
flag.StringVar(&confPath, "c", util.RelativePath("conf.ini"), "配置文件路径")
flag.BoolVar(&isEject, "eject", false, "导出内置静态资源")
flag.StringVar(&scriptName, "database-script", "", "运行内置数据库助手脚本")
flag.Parse()
bootstrap.Init(confPath)
}
@@ -28,6 +30,12 @@ func main() {
return
}
if scriptName != "" {
// 开始运行助手数据库脚本
bootstrap.RunScript(scriptName)
return
}
api := routers.InitRouter()
// 如果启用了SSL