Class: Makit::Cli::AddRepositoryCommand

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

Overview

Add repository to tracking list

Instance Method Summary collapse

Instance Method Details

#executeObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/makit/cli/repository_commands.rb', line 39

def execute
  validate_git_url(git_url)

  if add_to_tracked_list(git_url)
    puts "✅ Successfully added repository to tracked list: #{git_url}"
  else
    puts "ℹ️  Repository already tracked: #{git_url}"
  end
rescue ArgumentError => e
  warn "❌ Invalid repository URL: #{e.message}"
  exit 1
rescue StandardError => e
  warn "❌ Failed to add repository: #{e.message}"
  exit 1
end