diff options
author | fx <[email protected]> | 2023-04-23 21:57:09 +0200 |
---|---|---|
committer | fx <[email protected]> | 2023-04-23 21:57:09 +0200 |
commit | 99c84b5a81f395f4f094b157019e84bfc4459df6 (patch) | |
tree | f852fd5cc3b26a004cf7bfab054e86c0d74c4669 /src/files.rs | |
parent | 416f4dc383ff5a1194da3a5532a8e159a4a1dac0 (diff) | |
parent | 3e65975227baa511f570e8223fccda5607cf905e (diff) | |
download | modlist-99c84b5a81f395f4f094b157019e84bfc4459df6.tar modlist-99c84b5a81f395f4f094b157019e84bfc4459df6.tar.gz modlist-99c84b5a81f395f4f094b157019e84bfc4459df6.zip |
Merge pull request 'added config argument, remove devdir' (#2) from dev into cache
Reviewed-on: http://raspberrypi.fritz.box:7920/fx/modlist/pulls/2
Diffstat (limited to 'src/files.rs')
-rw-r--r-- | src/files.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/files.rs b/src/files.rs index ecf9b52..0b5bc3f 100644 --- a/src/files.rs +++ b/src/files.rs | |||
@@ -11,12 +11,12 @@ use crate::{ | |||
11 | db::{mods_get_info, userlist_add_disabled_versions}, | 11 | db::{mods_get_info, userlist_add_disabled_versions}, |
12 | error::{ErrorType, MLError, MLE}, | 12 | error::{ErrorType, MLError, MLE}, |
13 | modrinth::Version, | 13 | modrinth::Version, |
14 | List, cache::{get_cached_versions, copy_cached_version}, devdir, | 14 | List, cache::{get_cached_versions, copy_cached_version}, |
15 | }; | 15 | }; |
16 | 16 | ||
17 | pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>) -> MLE<String> { | 17 | pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>) -> MLE<String> { |
18 | 18 | ||
19 | let mut cached = get_cached_versions(&devdir(&config.cache)); | 19 | let mut cached = get_cached_versions(&config.cache); |
20 | 20 | ||
21 | println!("{:#?}", cached); | 21 | println!("{:#?}", cached); |
22 | 22 | ||
@@ -59,7 +59,7 @@ pub async fn download_versions(list: List, config: Cfg, versions: Vec<Version>) | |||
59 | //Force flush of stdout, else print! doesn't print instantly | 59 | //Force flush of stdout, else print! doesn't print instantly |
60 | std::io::stdout().flush().unwrap(); | 60 | std::io::stdout().flush().unwrap(); |
61 | let dl_path_file = format!("{}/{}", list.download_folder, filename); | 61 | let dl_path_file = format!("{}/{}", list.download_folder, filename); |
62 | let cache_path = format!("{}/{}", devdir(&config.clone().cache), filename); | 62 | let cache_path = format!("{}/{}", &config.clone().cache, filename); |
63 | // println!("{}:{}", dl_path_file, cache_path); | 63 | // println!("{}:{}", dl_path_file, cache_path); |
64 | copy(dl_path_file, cache_path)?; | 64 | copy(dl_path_file, cache_path)?; |
65 | println!(" ✓"); | 65 | println!(" ✓"); |