Skip to content

Commit

Permalink
Results output update
Browse files Browse the repository at this point in the history
  • Loading branch information
abdolence committed Sep 1, 2024
1 parent 806b23c commit 670e17d
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,35 +86,35 @@ async fn handle_args(cli: CliArgs, term: &Term) -> AppResult<()> {
redacter_args.map(|args| args.try_into()).transpose()?,
)
.await?;
if let Some(json_path) = save_json_results {
let json_result = serde_json::to_string_pretty(&copy_result)?;
let mut file = tokio::fs::File::create(&json_path).await?;
tokio::io::AsyncWriteExt::write_all(&mut file, json_result.as_bytes()).await?;
term.write_line(
format!(
"Results saved to JSON file: {}",
Style::new().bold().apply_to(json_path.display())
)
.as_str(),
)?;
}
term.write_line(
format!(
"\n{} -> {}: {} files copied ({} redacted). {} files skipped.",
source,
destination,
"Finished: {} -> {}\nCopied: {}. Redacted: {}. Skipped: {}.",
Style::new().bold().apply_to(source),
Style::new().green().apply_to(destination),
Style::new()
.bold()
.green()
.apply_to(copy_result.files_copied),
Style::new()
.bold()
.green()
.dim()
.apply_to(copy_result.files_redacted),
Style::new().yellow().apply_to(copy_result.files_skipped),
)
.as_str(),
)?;
if let Some(json_path) = save_json_results {
let json_result = serde_json::to_string_pretty(&copy_result)?;
let mut file = tokio::fs::File::create(&json_path).await?;
tokio::io::AsyncWriteExt::write_all(&mut file, json_result.as_bytes()).await?;
term.write_line(
format!(
"Results saved to JSON file: {}",
Style::new().bold().apply_to(json_path.display())
)
.as_str(),
)?;
}
}
CliCommand::Ls {
source,
Expand Down

0 comments on commit 670e17d

Please sign in to comment.