mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-01 05:36:19 +01:00
Merge pull request #625 from appleboy/improve
refactor: check the error returned by os.MkdirAll()
This commit is contained in:
commit
ecfa284662
1 changed files with 3 additions and 1 deletions
|
@ -660,7 +660,9 @@ please consider changing to GITEA_CUSTOM`)
|
|||
|
||||
cfg.Section("server").Key("LFS_JWT_SECRET").SetValue(LFS.JWTSecretBase64)
|
||||
|
||||
os.MkdirAll(filepath.Dir(CustomConf), os.ModePerm)
|
||||
if err := os.MkdirAll(filepath.Dir(CustomConf), os.ModePerm); err != nil {
|
||||
log.Fatal(4, "Fail to create '%s': %v", CustomConf, err)
|
||||
}
|
||||
if err := cfg.SaveTo(CustomConf); err != nil {
|
||||
log.Fatal(4, "Error saving generated JWT Secret to custom config: %v", err)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue