make beaty output

This commit is contained in:
Alexander Popov 2022-08-13 11:39:51 +03:00
parent c8d0aa91e9
commit 1eca440f02
Signed by: iiiypuk
GPG Key ID: D8C9B59A9F04A70C

View File

@ -4,12 +4,14 @@ repos_dirs = [""]
def check_repo(repo_path : String) def check_repo(repo_path : String)
repo_name = repo_path.split("/")[-1] 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? if !ahead_count.empty?
print "* #{ahead_count}\t".colorize(:red).mode(:bold)
print repo_name.colorize(:yellow) print repo_name.colorize(:yellow)
print " " * (25 - repo_name.size) print " ["
print ahead_count.to_s.colorize(:green).mode(:bold) print repo_path.colorize(:light_magenta)
puts "]"
end end
end end