diff options
author | fxqnlr <[email protected]> | 2023-04-23 18:24:32 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2023-04-23 18:24:32 +0200 |
commit | 416f4dc383ff5a1194da3a5532a8e159a4a1dac0 (patch) | |
tree | c3d00456cafa01bfbe620aed85b25caa60b4e29d /src/config.rs | |
parent | 4300ad2eb05dddfa4274e04b204f2ad28c87da05 (diff) | |
download | modlist-416f4dc383ff5a1194da3a5532a8e159a4a1dac0.tar modlist-416f4dc383ff5a1194da3a5532a8e159a4a1dac0.tar.gz modlist-416f4dc383ff5a1194da3a5532a8e159a4a1dac0.zip |
added caching, better data location
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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}; | |||
10 | #[derive(Debug, Clone, Serialize, Deserialize)] | 10 | #[derive(Debug, Clone, Serialize, Deserialize)] |
11 | pub struct Cfg { | 11 | pub struct Cfg { |
12 | pub data: String, | 12 | pub data: String, |
13 | pub cache: String, | ||
13 | pub apis: Apis, | 14 | pub apis: Apis, |
14 | } | 15 | } |
15 | 16 | ||
@@ -28,7 +29,8 @@ impl Cfg { | |||
28 | if err.kind() == std::io::ErrorKind::NotFound { | 29 | if err.kind() == std::io::ErrorKind::NotFound { |
29 | println!("No config file found, creating one"); | 30 | println!("No config file found, creating one"); |
30 | let default_cfg = Cfg { | 31 | let default_cfg = Cfg { |
31 | data: String::from("./"), | 32 | data: String::from("~/.cache/modlist/"), |
33 | cache: String::from("~/.cache/modlist/cache"), | ||
32 | apis: Apis { | 34 | apis: Apis { |
33 | modrinth: String::from("https://api.modrinth.com/v2/"), | 35 | modrinth: String::from("https://api.modrinth.com/v2/"), |
34 | }, | 36 | }, |