try to fix paths for windows

This commit is contained in:
Max Bradbury 2021-04-26 21:58:11 +01:00
parent 005c90adb0
commit 6ac967c6d9
1 changed files with 7 additions and 3 deletions

View File

@ -23,7 +23,8 @@ fn save_config(config: Config) {
let mut config_path = dirs::config_dir()
.expect("Couldn't find user config directory");
config_path.push("ruin/lull");
config_path.push("ruin");
config_path.push("lull");
if !config_path.exists() {
std::fs::create_dir_all(&config_path)
@ -46,7 +47,9 @@ fn load_config() -> Option<Config> {
let mut config_path = dirs::config_dir()
.expect("Couldn't find user config directory");
config_path.push("ruin/lull/lull.toml");
config_path.push("ruin");
config_path.push("lull");
config_path.push("lull.toml");
let file = File::open(config_path);
@ -93,7 +96,8 @@ fn error_popup(message: &str) {
fn get_data_dir() -> PathBuf {
let mut data_dir = dirs::data_dir().expect("Couldn't find user data directory");
data_dir.push("ruin/lull");
data_dir.push("ruin");
data_dir.push("lull");
if !data_dir.exists() {
std::fs::create_dir_all(&data_dir).expect("Couldn't create lull data directory");