🐛 Fix the temp folder is not created at the first startup

pull/548/head
Xhofe 2022-02-08 16:22:53 +08:00
parent ba99c7dc03
commit bef3d2f88d
1 changed files with 4 additions and 4 deletions

View File

@ -10,6 +10,10 @@ import (
// InitConf init config
func InitConf() {
err := os.MkdirAll("data/temp", 0700)
if err != nil {
log.Fatalf("create temp dir error: %s", err.Error())
}
log.Infof("reading config file: %s", conf.ConfigFile)
if !utils.Exists(conf.ConfigFile) {
log.Infof("config file not exists, creating default config file")
@ -42,8 +46,4 @@ func InitConf() {
if err != nil {
log.Fatalf("update config struct error: %s", err.Error())
}
err = os.MkdirAll("data/temp", 0700)
if err != nil {
log.Fatalf("create temp dir error: %s", err.Error())
}
}