From 57f6e70471736e9f34f0e732606b71c799c59e78 Mon Sep 17 00:00:00 2001 From: Vince Buffalo Date: Tue, 5 Sep 2023 12:34:48 -0700 Subject: [PATCH] nicer status for when a data is in root dir --- src/lib/utils.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/utils.rs b/src/lib/utils.rs index b8e4957..d76a334 100644 --- a/src/lib/utils.rs +++ b/src/lib/utils.rs @@ -151,8 +151,9 @@ pub fn print_fixed_width_status(rows: BTreeMap>, nspace dir_keys.sort(); for key in dir_keys { let statuses = &rows[key]; - let pretty_key = if color { key.bold().to_string() } else { key.clone() }; - println!("[{}]", pretty_key); + let pretty_key = if key.len() == 0 { "." } else { &key }; + let prettier_key = if color { pretty_key.bold().to_string() } else { pretty_key.clone().to_string() }; + println!("[{}]", prettier_key); // Print the rows with the correct widths for status in statuses { @@ -261,7 +262,6 @@ fn get_counts(rows: &BTreeMap>) -> Result { pub fn print_status(rows: BTreeMap>, remote: Option<&HashMap>, all: bool) { - println!("--> {:?}", rows); println!("{}", "Project data status:".bold()); let counts = get_counts(&rows).expect("Internal Error: get_counts() panicked."); println!("{} local and tracked by a remote ({} only local, {} only remote), {} total.\n",