use colored::Colorize;
use std::{time::SystemTime, process::Command};
pub fn log_execution_time(start_time: SystemTime) {
let end_time = SystemTime::now();
println!(
"\n💥 Done in {}ms.",
end_time.duration_since(start_time).unwrap().as_millis()
);
}
pub fn log_dry_run_note() {
println!(
"\n{}",
"NOTE: The \"--dry-run\" flag means no changes were made."
.yellow()
.bold()
);
}
pub fn log_repo_status(dry_run: bool) {
println!(
"{}\n",
"Repository status:".yellow()
);
let status_raw = Command::new("git")
.arg("status")
.arg("--short")
.output()
.expect("Failed to get git status").stdout;
let status = String::from_utf8_lossy(&status_raw).to_string();
print!("{}", status.green());
}