Skip to content

Commit cfe251d

Browse files
Fix #120
1 parent 2181767 commit cfe251d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Fix [#118](https://github.com/gorilla-devs/ferium/issues/118), the `--output-dir` flag is now optional
88
- Fix [#111](https://github.com/gorilla-devs/ferium/issues/111)
99
- Fix [#121](https://github.com/gorilla-devs/ferium/issues/121), the add command just shows a warning for optional mods that are incompatible
10+
- Fix [#120](https://github.com/gorilla-devs/ferium/issues/120), duplicate files are no longer downloaded. Also, a warning so that you remove the duplicate mod
1011

1112
## `v4.1.1`
1213
### 31.05.2022

src/download.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ pub async fn clean(
2929
to_download: &mut Vec<Downloadable>,
3030
to_install: &mut Vec<(OsString, PathBuf)>,
3131
) -> Result<()> {
32+
let len = to_download.len();
33+
to_download.sort_unstable_by_key(|downloadable| downloadable.output.clone());
34+
to_download.dedup_by_key(|downloadable| downloadable.output.clone());
35+
if to_download.len() < len {
36+
println!(
37+
"{}",
38+
format!(
39+
"Warning: {} duplicate files were found, please check your mods for duplicates!",
40+
len - to_download.len()
41+
)
42+
.yellow()
43+
.bold()
44+
);
45+
}
3246
create_dir_all(directory.join(".old")).await?;
3347
for file in read_dir(&directory)? {
3448
let file = file?;

0 commit comments

Comments
 (0)