lib/git_gc_cron/cli.rb in git-gc-cron-0.0.2 vs lib/git_gc_cron/cli.rb in git-gc-cron-0.0.3
- old
+ new
@@ -1,12 +1,14 @@
module GitGcCron
class CLI
def self.start
+ verbose = ARGV.first == '-v' and ARGV.shift
ARGV.each do |base|
repos = Dir["#{base}/**/{.git,*.git}"]
repos.each_with_index do |repo_path, i|
Dir.chdir(repo_path) do
+ puts repo_path if verbose
system ["git", "(##{i + 1}/#{repos.size + 1} #{repo_path}) git"], "gc", "-q"
end
end
end
end