Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 751f043

Browse files
committedMar 30, 2021
update pack and unpack tools
1 parent 14cd434 commit 751f043

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed
 

‎tools/pmfextract/src/main.rs

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
use clap::{App, Arg};
2-
use libpolymesh::file::{
3-
compressed::unpack_pmf,
4-
data::polymeta::parse_poly_meta
5-
};
2+
use libpolymesh::read::unpack_pmf;
63

74
fn main() {
85
let matches = App::new("PMFExtract")
@@ -26,13 +23,8 @@ fn main() {
2623
let output_path = matches.value_of("to").unwrap();
2724

2825
// Unpack the file
26+
println!("Unpacking PolyMesh...");
2927
let _ = unpack_pmf(root_path, output_path).unwrap();
30-
31-
// Ensure there is a ploymeta inside the root
32-
let polymeta = parse_poly_meta(&format!("{}/polymeta.json", output_path).to_string()).unwrap();
33-
34-
// Log file information
35-
println!("PMF version: {}", polymeta.version);
36-
println!("Children: {}", polymeta.children.len());
28+
println!("Done");
3729

3830
}

‎tools/pmfpack/src/main.rs

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
use clap::{App, Arg};
2-
use libpolymesh::file::{
3-
extracted::pack_pmf,
4-
data::polymeta::parse_poly_meta
5-
};
2+
use libpolymesh::write::pack_pmf;
63

74
fn main() {
85
let matches = App::new("PMFPack")
@@ -25,14 +22,9 @@ fn main() {
2522
let root_path = matches.value_of("from").unwrap();
2623
let output_path = matches.value_of("to").unwrap();
2724

28-
// Ensure there is a ploymeta inside the root
29-
let polymeta = parse_poly_meta(&format!("{}/polymeta.json", root_path).to_string()).unwrap();
30-
31-
// Log file information
32-
println!("PMF version: {}", polymeta.version);
33-
println!("Children: {}", polymeta.children.len());
34-
3525
// Pack the file
26+
println!("Packing PolyMesh...");
3627
let _ = pack_pmf(root_path, output_path).unwrap();
28+
println!("Done");
3729

3830
}

0 commit comments

Comments
 (0)