Fix sqlite db wrong path
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::path::{PathBuf};
|
||||
use ini::Ini;
|
||||
use crate::config::types::{ApplicationConfig, BasicConfig};
|
||||
use crate::constants::APP_CONFIG_DIR;
|
||||
use crate::constants::{APP_CONFIG_DIR, APP_CONIFG_FILE_PATH};
|
||||
|
||||
pub mod types;
|
||||
|
||||
@@ -19,12 +19,14 @@ impl ApplicationConfig {
|
||||
}
|
||||
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
let conf = Self {
|
||||
basic_config: BasicConfig {
|
||||
db_path: APP_CONFIG_DIR.clone().to_str().unwrap().to_string(),
|
||||
db_path: APP_CONFIG_DIR.clone().join("games.db").to_str().unwrap().to_string(),
|
||||
tick_rate: 250
|
||||
}
|
||||
}
|
||||
};
|
||||
conf.clone().write_to_file(APP_CONIFG_FILE_PATH.to_path_buf());
|
||||
conf
|
||||
}
|
||||
|
||||
pub fn write_to_file(self, path: PathBuf) {
|
||||
|
||||
Reference in New Issue
Block a user