admin: ensure _public is created at startup
This commit is contained in:
parent
17d983221d
commit
88ef2f64c0
1 changed files with 6 additions and 0 deletions
|
@ -72,6 +72,12 @@ func savePublic(_ httprouter.Params, body []byte) (interface{}, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if _, err := os.Stat(path.Join(TeamsDir, "_public")); os.IsNotExist(err) {
|
||||
if err := os.Mkdir(path.Join(TeamsDir, "_public"), 0750); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if err := savePublicTo(path.Join(TeamsDir, "_public", "public.json"), scenes); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
|
|
Reference in a new issue