Use config folder (#110)

This commit is contained in:
Philip Kristoffersen
2022-05-01 07:14:24 +02:00
committed by GitHub
parent 44bebfc59e
commit 9fdf56d5ed
9 changed files with 117 additions and 18 deletions
+10
View File
@@ -1,10 +1,12 @@
mod amazon;
mod config;
mod egs;
mod gog;
mod heroic;
mod itch;
mod legendary;
mod lutris;
mod migration;
mod origin;
mod platform;
mod settings;
@@ -16,6 +18,9 @@ mod uplay;
use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
ensure_config_folder();
migration::migrate_config();
let mut args = std::env::args();
if args.len() > 1 && args.nth(1).unwrap_or_default() == "--no-ui" {
ui::run_sync();
@@ -24,3 +29,8 @@ fn main() -> Result<(), Box<dyn Error>> {
ui::run_ui()
}
}
fn ensure_config_folder() {
let path = config::get_config_folder();
let _ = std::fs::create_dir_all(&path);
}