Compare commits

...

2 Commits

Author SHA1 Message Date
77f80ca23d added path lowercase to ModFile 2026-02-28 22:26:20 +01:00
bc424087a2 removed path lowercase from linker 2026-02-28 22:25:45 +01:00
2 changed files with 9 additions and 7 deletions

View File

@@ -20,7 +20,7 @@ impl Linker {
}
fn link_file(&self, from: &Path, to: &Path) -> Result<(), LinkerError> {
let target = self.target.join(path_to_lowercase(to));
let target = self.target.join(to);
if let Some(parent) = target.parent() {
fs::create_dir_all(parent)?;
@@ -93,7 +93,7 @@ impl Linker {
for entry in fs::read_dir(src)? {
let entry = entry?;
let src_path = entry.path();
let dst_path = dst.join(path_to_lowercase(&entry.path()).file_name().unwrap());
let dst_path = dst.join(entry.path().file_name().unwrap());
let meta = entry.metadata()?;
if meta.is_dir() {
@@ -133,10 +133,6 @@ impl From<io::Error> for LinkerError {
}
}
fn path_to_lowercase(path: &Path) -> PathBuf {
PathBuf::from(path.to_string_lossy().to_lowercase())
}
fn create_symlink_for_file(src: &Path, dst: &Path) -> io::Result<()> {
let absolute_path = fs::canonicalize(src)?;

View File

@@ -28,9 +28,11 @@ struct ModFile {
impl ModFile {
#[inline]
pub fn new_from_installer(file: FileType) -> Self {
let dest: PathBuf = file.destination.unwrap_or_default().into();
ModFile {
source: file.source.into(),
dest: file.destination.unwrap_or_default().into(),
dest: Self::path_to_lowercase(&dest),
internal_priority: file.priority.unwrap_or(0),
}
}
@@ -61,6 +63,10 @@ impl ModFile {
}
}
}
fn path_to_lowercase(path: &Path) -> PathBuf {
PathBuf::from(path.to_string_lossy().to_lowercase())
}
}
pub fn walk_files_recursive(