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]] [[package]]
name = "lwa_unity_unpack" name = "lwa_unity_unpack"
version = "0.1.0" version = "0.2.0"
dependencies = [ dependencies = [
"clap", "clap",
"flate2", "flate2",

View File

@ -42,7 +42,7 @@ pub fn extract_archive(archive_path: &Path, extract_to: &Path) -> io::Result<()>
fn main() { fn main() {
let args: Args = Args::parse(); 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 archive_path = Path::new(&args.input);
let tmp_dir = Path::new("./tmp_dir"); let tmp_dir = Path::new("./tmp_dir");
let output_dir = Path::new(&args.output); let output_dir = Path::new(&args.output);
@ -82,10 +82,12 @@ fn main() {
match line { match line {
Some(Ok(path)) => { Some(Ok(path)) => {
real_path = 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)); extension = Some(String::from(e));
} }
}, }
_ => continue, _ => continue,
} }
} else if file_name == "asset" { } else if file_name == "asset" {