fix docker
CI / Build binary CI (push) Successful in 2h46m38s Details

This commit is contained in:
huoxue1 2023-10-06 11:19:30 +08:00
parent 80732b2e2a
commit e8433180b4
2 changed files with 11 additions and 6 deletions

3
.gitignore vendored
View File

@ -6,3 +6,6 @@
/config/config.yml
/chromium-857950/
/tools
QuestionBank.db
config/user.db
pid.pid

14
main.go
View File

@ -29,6 +29,7 @@ import (
"github.com/sjkhsl/study_xxqg/conf"
"github.com/sjkhsl/study_xxqg/lib/state"
"github.com/sjkhsl/study_xxqg/utils"
// "github.com/sjkhsl/study_xxqg/gui"
"github.com/sjkhsl/study_xxqg/lib"
"github.com/sjkhsl/study_xxqg/model"
@ -47,12 +48,7 @@ var (
var VERSION = "unknown"
func init() {
if i {
core := &lib.Core{}
core.Init()
core.Quit()
os.Exit(0)
}
if runtime.GOOS != "windows" {
runBack()
}
@ -72,6 +68,12 @@ func init() {
flag.BoolVar(&now, "now", false, "run cron now")
flag.StringVar(&configPath, "config", "./config/config.yml", "设置配置文件路径")
flag.Parse()
if i {
core := &lib.Core{}
core.Init()
core.Quit()
os.Exit(0)
}
// 初始化配置文件
conf.InitConfig(configPath, utils.Restart)
config = conf.GetConfig()