mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-06 04:48:54 +08:00
Allow to load files without case sensitive
This commit is contained in:
@@ -99,6 +99,7 @@ impl CrxdImage {
|
||||
} else {
|
||||
let mut nf = std::path::PathBuf::from(filename);
|
||||
nf.set_file_name(name);
|
||||
nf = crate::utils::files::get_ignorecase_path(&nf)?;
|
||||
let f = std::fs::File::open(nf)?;
|
||||
CrxImage::new(std::io::BufReader::new(f), config)?
|
||||
}
|
||||
|
||||
@@ -189,7 +189,8 @@ impl DpakLoader {
|
||||
let dpak = match self.map.get(dpak) {
|
||||
Some(d) => d,
|
||||
None => {
|
||||
let path = dir.join(dpak);
|
||||
let mut path = dir.join(dpak);
|
||||
path = crate::utils::files::get_ignorecase_path(&path)?;
|
||||
let ndpak = Dpak::new(&path)?;
|
||||
self.map.insert(dpak.to_string(), ndpak);
|
||||
self.map.get(dpak).unwrap()
|
||||
|
||||
@@ -99,6 +99,7 @@ impl SoftpalScript {
|
||||
} else {
|
||||
let mut path = std::path::PathBuf::from(filename);
|
||||
path.set_file_name(name);
|
||||
path = crate::utils::files::get_ignorecase_path(&path)?;
|
||||
std::fs::read(path).map_err(|e| anyhow::anyhow!("Failed to read file {}: {}", name, e))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user