This commit is contained in:
Piotr Siuszko 2023-12-27 21:35:21 +01:00
parent f68aeca902
commit 30626bab1f
2 changed files with 9 additions and 7 deletions

2
Cargo.lock generated
View File

@ -225,7 +225,7 @@ checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456"
[[package]]
name = "lwa_unity_unpack"
version = "0.1.0"
version = "0.2.0"
dependencies = [
"clap",
"flate2",

View File

@ -42,7 +42,7 @@ pub fn extract_archive(archive_path: &Path, extract_to: &Path) -> io::Result<()>
fn main() {
let args: Args = Args::parse();
let ignored_extensions = args.ignore_extensions.unwrap_or(vec![]);
let ignored_extensions = args.ignore_extensions.unwrap_or_default();
let archive_path = Path::new(&args.input);
let tmp_dir = Path::new("./tmp_dir");
let output_dir = Path::new(&args.output);
@ -82,10 +82,12 @@ fn main() {
match line {
Some(Ok(path)) => {
real_path = path;
if let Some(e) = Path::new(&real_path).extension().and_then(OsStr::to_str) {
if let Some(e) =
Path::new(&real_path).extension().and_then(OsStr::to_str)
{
extension = Some(String::from(e));
}
},
}
_ => continue,
}
} else if file_name == "asset" {