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