diff --git a/modda-lib/Cargo.toml b/modda-lib/Cargo.toml index b1d564e..3cc67b1 100644 --- a/modda-lib/Cargo.toml +++ b/modda-lib/Cargo.toml @@ -38,6 +38,7 @@ path-absolutize = "3.1.1" percent-encoding = "2.3.2" regex = "1.12.3" reqwest = { version = "0.13.2", features = ["stream", "json"] } +same-file = "1.0.6" serde = { version = "1.0.228", features = ["derive"] } serde_json = "1.0.149" serde_path_to_error = "0.1.20" diff --git a/modda-lib/resources/test/file_lookup/conflicts/MOD1 b/modda-lib/resources/test/file_lookup/conflicts/MOD1 new file mode 120000 index 0000000..24eb79d --- /dev/null +++ b/modda-lib/resources/test/file_lookup/conflicts/MOD1 @@ -0,0 +1 @@ +mod1 \ No newline at end of file diff --git a/modda-lib/resources/test/file_lookup/conflicts/MOD2 b/modda-lib/resources/test/file_lookup/conflicts/MOD2 new file mode 100644 index 0000000..f6531e1 --- /dev/null +++ b/modda-lib/resources/test/file_lookup/conflicts/MOD2 @@ -0,0 +1 @@ +This is NOT a symlink to mod2 diff --git a/modda-lib/resources/test/file_lookup/conflicts/mod1 b/modda-lib/resources/test/file_lookup/conflicts/mod1 new file mode 100644 index 0000000..4f9f8e3 --- /dev/null +++ b/modda-lib/resources/test/file_lookup/conflicts/mod1 @@ -0,0 +1 @@ +MOD1 is a symlink to mod1 diff --git a/modda-lib/resources/test/file_lookup/conflicts/mod2 b/modda-lib/resources/test/file_lookup/conflicts/mod2 new file mode 100644 index 0000000..67baeb0 --- /dev/null +++ b/modda-lib/resources/test/file_lookup/conflicts/mod2 @@ -0,0 +1 @@ +MOD2 is NOT a symlink to mod2 diff --git a/modda-lib/src/download.rs b/modda-lib/src/download.rs index 64416e0..5dbc1d2 100644 --- a/modda-lib/src/download.rs +++ b/modda-lib/src/download.rs @@ -89,7 +89,7 @@ impl Downloader { // Indicatif setup - let pb = match (total_size) { + let pb = match total_size { Some(total_size) => Self::progress_with_size(total_size)?, None => match &download_opts.size_hint{ None =>{ diff --git a/modda-lib/src/utils/insensitive.rs b/modda-lib/src/utils/insensitive.rs index 371c73b..665fc12 100644 --- a/modda-lib/src/utils/insensitive.rs +++ b/modda-lib/src/utils/insensitive.rs @@ -3,7 +3,9 @@ use std::io::ErrorKind; use std::path::{Path, PathBuf}; use anyhow::{Result, bail}; -use log::debug; +use itertools::Itertools; +use log::{debug, info}; +use same_file::Handle; /// Looks for a file matching the argument, allowing case-insensitive matches. /// @@ -20,10 +22,15 @@ pub fn find_insensitive
(base: P, searched: &str) -> Result