From 416f4dc383ff5a1194da3a5532a8e159a4a1dac0 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Sun, 23 Apr 2023 18:24:32 +0200 Subject: added caching, better data location --- src/config.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 1b54d5f..a9a937e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -10,6 +10,7 @@ use crate::{devdir, error::MLE}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Cfg { pub data: String, + pub cache: String, pub apis: Apis, } @@ -28,7 +29,8 @@ impl Cfg { if err.kind() == std::io::ErrorKind::NotFound { println!("No config file found, creating one"); let default_cfg = Cfg { - data: String::from("./"), + data: String::from("~/.cache/modlist/"), + cache: String::from("~/.cache/modlist/cache"), apis: Apis { modrinth: String::from("https://api.modrinth.com/v2/"), }, -- cgit v1.2.3