From 1eca440f023b887ee67907b8d2ff3513199de8f6 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sat, 13 Aug 2022 11:39:51 +0300 Subject: [PATCH] make beaty output --- src/git-ahead-check.cr | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/git-ahead-check.cr b/src/git-ahead-check.cr index 587df5c..2a9c642 100644 --- a/src/git-ahead-check.cr +++ b/src/git-ahead-check.cr @@ -4,12 +4,14 @@ repos_dirs = [""] def check_repo(repo_path : String) repo_name = repo_path.split("/")[-1] - ahead_count = `git -C #{repo_path} status | grep -i "Your branch" | grep -Eo "[0-9]"` + ahead_count = `git -C #{repo_path} status | grep -i "Your branch" | grep -Eo "[0-9]"`.chomp if !ahead_count.empty? + print "* #{ahead_count}\t".colorize(:red).mode(:bold) print repo_name.colorize(:yellow) - print " " * (25 - repo_name.size) - print ahead_count.to_s.colorize(:green).mode(:bold) + print " [" + print repo_path.colorize(:light_magenta) + puts "]" end end