diff --git a/server/src/persistence/mod.rs b/server/src/persistence/mod.rs index e1addc9c4c..d33803db66 100644 --- a/server/src/persistence/mod.rs +++ b/server/src/persistence/mod.rs @@ -12,6 +12,7 @@ use common::comp; use refinery::Report; use rusqlite::{Connection, OpenFlags}; use std::{ + fs, path::PathBuf, sync::{Arc, RwLock}, time::Duration, @@ -130,6 +131,10 @@ fn rusqlite_profile_callback(log_message: &str, dur: Duration) { } pub(crate) fn establish_connection(settings: &DatabaseSettings) -> VelorenConnection { + fs::create_dir_all(&settings.db_dir).expect(&*format!( + "Failed to create saves directory: {:?}", + &settings.db_dir + )); let connection = Connection::open_with_flags( &settings.db_dir.join("db.sqlite"), OpenFlags::SQLITE_OPEN_PRIVATE_CACHE | OpenFlags::default(), diff --git a/voxygen/src/singleplayer.rs b/voxygen/src/singleplayer.rs index c6c5e026c8..8cd06499e0 100644 --- a/voxygen/src/singleplayer.rs +++ b/voxygen/src/singleplayer.rs @@ -62,8 +62,9 @@ impl Singleplayer { }; info!( - "Saves folder doesn't exist, but there is one in the old saves location, copying \ - it to the new location" + "Saves folder doesn't exist, but there is one in the old saves location ({}), \ + copying it to the new location", + old_path.display() ); if let Some(parent) = new_path.parent() { if let Err(e) = std::fs::create_dir_all(parent) {