Skip to content

Commit

Permalink
rename all binaries added to the mod id
Browse files Browse the repository at this point in the history
  • Loading branch information
camila314 committed Nov 27, 2022
1 parent 2e8abdd commit 305ea79
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,12 @@ fn create_package(
}

for binary in &binaries {
std::fs::copy(binary, working_dir.join(binary.file_name().unwrap()))
let mut binary_name = binary.file_name().unwrap().to_str().unwrap().to_string();
if let Some(ext) = [".ios.dylib", ".dylib", ".dll", ".lib", ".so"].iter().find(|x| **x == binary_name) {
binary_name = mod_file_info.id.to_string() + ext;
}

std::fs::copy(binary, working_dir.join(binary_name))
.nice_unwrap(format!("Unable to copy binary at '{}'", binary.display()));
}

Expand Down

0 comments on commit 305ea79

Please sign in to comment.