diff --git a/exe/collect-repos b/exe/collect-repos index 50d0f47..7024b0d 100755 --- a/exe/collect-repos +++ b/exe/collect-repos @@ -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,10 +18,15 @@ 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( - hide_cursor: true, + hide_cursor: true, clear: true ) @@ -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|