table render
This commit is contained in:
parent
56373a75ee
commit
2a7a225024
@ -1,5 +1,5 @@
|
||||
name: git-ahead-check
|
||||
version: 0.2.0
|
||||
version: 0.3.0
|
||||
|
||||
authors:
|
||||
- Alexander Popov <iiiypuk@fastmail.fm>
|
||||
|
@ -26,18 +26,26 @@ if File.exists?(CONFIG_PATH)
|
||||
sleep(600)
|
||||
`notify-send --app-name=git-ahead-check --icon=flag-red --urgency=normal GIT-AHEAD "Unpushed repos: #{repositoryes.size}"`
|
||||
else
|
||||
repositoryes.each { |repo|
|
||||
print "* #{repo[:ahead]}\t".colorize(:red).mode(:bold)
|
||||
print repo[:name].colorize(:yellow)
|
||||
repos_table = Tallboy.table do
|
||||
header [
|
||||
"Ahead".colorize.mode(:bold),
|
||||
"Repo name".colorize.mode(:bold),
|
||||
if !ARGV_VARS.short
|
||||
"Repo path".colorize.mode(:bold)
|
||||
end,
|
||||
]
|
||||
repositoryes.each { |repo|
|
||||
row [
|
||||
repo[:ahead].colorize(:red).mode(:bold),
|
||||
repo[:name].colorize(:yellow),
|
||||
if !ARGV_VARS.short
|
||||
repo[:path].sub("$HOME", ENV["HOME"]).colorize(:light_magenta)
|
||||
end,
|
||||
]
|
||||
}
|
||||
end
|
||||
|
||||
if !ARGV_VARS.short
|
||||
print " ["
|
||||
print repo[:path].colorize(:light_magenta)
|
||||
print "]"
|
||||
end
|
||||
}
|
||||
|
||||
puts
|
||||
puts repos_table
|
||||
end
|
||||
else
|
||||
Dir.mkdir_p(File.dirname(CONFIG_PATH))
|
||||
|
Loading…
Reference in New Issue
Block a user