Ensure the root directory for a server is always create when booting wings

This commit is contained in:
Dane Everitt
2021-01-23 10:45:29 -08:00
parent 5d070cbdc5
commit 93506994a5
3 changed files with 31 additions and 30 deletions

View File

@@ -164,6 +164,12 @@ func rootCmdRun(cmd *cobra.Command, _ []string) {
for _, serv := range server.GetServers().All() {
s := serv
// For each server we encounter make sure the root data directory exists.
if err := s.EnsureDataDirectoryExists(); err != nil {
s.Log().Error("could not create root data directory for server: not loading server...")
continue
}
pool.Submit(func() {
s.Log().Info("configuring server environment and restoring to previous state")