Compare commits
2 Commits
68975dbc81
...
77f80ca23d
| Author | SHA1 | Date | |
|---|---|---|---|
|
77f80ca23d
|
|||
|
bc424087a2
|
@@ -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)?;
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user