Class: Makit::Cli::ImportRepositoryCommand

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/makit/cli/repository_commands.rb

Overview

Import repositories from filesystem

Instance Method Summary collapse

Instance Method Details

#executeObject



531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
# File 'lib/makit/cli/repository_commands.rb', line 531

def execute
  search_dir = directory
  unless Dir.exist?(search_dir)
    puts "Directory does not exist: #{search_dir}"
    exit 1
  end

  puts "Searching for git repositories in: #{search_dir}"
  puts "Max depth: #{max_depth}"
  puts "Rakefile required: #{!skip_rakefile_check?}"

  repositories = discover_repositories(search_dir)

  if repositories.empty?
    puts "No repositories found"
    return
  end

  puts "\nFound #{repositories.length} repositories:"
  repositories.each { |repo| puts "  - #{repo[:url] || repo[:path]}" }

  return if dry_run?

  import_repositories(repositories)
end