mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +01:00
Show mount upload percentage
This commit is contained in:
@@ -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");
|
||||||
|
|||||||
Reference in New Issue
Block a user