diff --git a/exe/collect-repos b/exe/collect-repos index db95e64..50d0f47 100755 --- a/exe/collect-repos +++ b/exe/collect-repos @@ -7,13 +7,18 @@ require 'find' require 'thor' require 'table_print' require 'tty-spinner' +require 'colorize' class ListRepos < Thor desc 'list [SELECTOR]', 'List repositories' method_option :root, type: :string, aliases: '-r' - def list(selector_str="") + def initialize(*args) + String.disable_colorization = true unless ENV['NO_COLOR'].nil? + super + end + basedir = options['root'] || '.' projects = [] spinner = TTY::Spinner.new( @@ -22,8 +27,8 @@ class ListRepos < Thor ) selector = self.class.build_selector(selector_str) - selector_str2 = selector.map { |k, v| "#{k}=#{v}" }.join(' ') - puts "selector = #{selector_str2}" + selector_str2 = selector.map { |k, v| "#{k}=#{v.to_s.colorize(:yellow)}" }.join(' AND ') + puts "SELECTOR: #{selector_str2}" ## COLLECT spinner.auto_spin