Add better cursor display management
This commit is contained in:
parent
7f9db265b4
commit
84615d228e
1 changed files with 9 additions and 2 deletions
|
@ -10,7 +10,6 @@ require 'tty-spinner'
|
|||
require 'colorize'
|
||||
|
||||
class ListRepos < Thor
|
||||
|
||||
desc 'list [SELECTOR]', 'List repositories'
|
||||
method_option :root, type: :string, aliases: '-r'
|
||||
|
||||
|
@ -19,6 +18,11 @@ class ListRepos < Thor
|
|||
super
|
||||
end
|
||||
|
||||
def list(selector_str='')
|
||||
trap 'SIGINT' do
|
||||
system 'tput cnorm' # show cursor (fix)
|
||||
exit! 130
|
||||
end
|
||||
basedir = options['root'] || '.'
|
||||
projects = []
|
||||
spinner = TTY::Spinner.new(
|
||||
|
@ -32,6 +36,7 @@ class ListRepos < Thor
|
|||
|
||||
## COLLECT
|
||||
spinner.auto_spin
|
||||
system 'tput civis' # hide cursor (fix)
|
||||
Find.find(basedir) do |path|
|
||||
next unless path =~ %r{.*/.git/config$}
|
||||
|
||||
|
@ -46,6 +51,8 @@ class ListRepos < Thor
|
|||
}
|
||||
end
|
||||
spinner.stop
|
||||
system 'tput cnorm' # show cursor (fix)
|
||||
puts ''
|
||||
|
||||
## REDUCE
|
||||
projects_selected = projects.select do |vals|
|
||||
|
|
Loading…
Reference in a new issue