init
This commit is contained in:
16
src/git-ahead-check.cr
Normal file
16
src/git-ahead-check.cr
Normal file
@@ -0,0 +1,16 @@
|
||||
require "colorize"
|
||||
|
||||
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]"`
|
||||
|
||||
if !ahead_count.empty?
|
||||
print repo_name.colorize(:yellow)
|
||||
print " " * (25 - repo_name.size)
|
||||
print ahead_count.to_s.colorize(:green).mode(:bold)
|
||||
end
|
||||
end
|
||||
|
||||
repos_dirs.each { |x| check_repo(x) }
|
Reference in New Issue
Block a user