Show mount upload percentage

This commit is contained in:
Jackson Coxson
2025-04-05 14:10:10 -06:00
parent 508b91d7cd
commit 031f54bab7

View File

@@ -1,7 +1,7 @@
// Jackson Coxson // Jackson Coxson
// Just lists apps for now // Just lists apps for now
use std::path::PathBuf; use std::{io::Write, path::PathBuf};
use clap::{arg, value_parser, Arg, Command}; use clap::{arg, value_parser, Arg, Command};
use idevice::{ use idevice::{
@@ -195,13 +195,22 @@ async fn main() {
.expect("Unexpected value for chip IP"); .expect("Unexpected value for chip IP");
mounter_client mounter_client
.mount_personalized( .mount_personalized_with_callback(
&*provider, &*provider,
image, image,
trust_cache, trust_cache,
build_manifest, build_manifest,
None, None,
unique_chip_id, unique_chip_id,
async |((n, d), _)| {
let percent = (n as f64 / d as f64) * 100.0;
print!("\rProgress: {:.2}%", percent);
std::io::stdout().flush().unwrap(); // Make sure it prints immediately
if n == d {
println!();
}
},
(),
) )
.await .await
.expect("Unable to mount"); .expect("Unable to mount");