🐛 Fix the temp folder is not created at the first startup
This commit is contained in:
parent
ba99c7dc03
commit
bef3d2f88d
@ -10,6 +10,10 @@ import (
|
|||||||
|
|
||||||
// InitConf init config
|
// InitConf init config
|
||||||
func InitConf() {
|
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)
|
log.Infof("reading config file: %s", conf.ConfigFile)
|
||||||
if !utils.Exists(conf.ConfigFile) {
|
if !utils.Exists(conf.ConfigFile) {
|
||||||
log.Infof("config file not exists, creating default config file")
|
log.Infof("config file not exists, creating default config file")
|
||||||
@ -42,8 +46,4 @@ func InitConf() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("update config struct error: %s", err.Error())
|
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())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user