Class: Makit::Cli::PullRepositoryCommand

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

Overview

Pull latest changes from repository

Instance Method Summary collapse

Instance Method Details

#executeObject



199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/makit/cli/repository_commands.rb', line 199

def execute
  commands = Makit.pull(git_repository)

  if commands.any? && commands.last.exit_code.zero?
    puts "Successfully pulled latest changes from: #{git_repository}"
  else
    warn "Failed to pull changes from: #{git_repository}"
    exit 1
  end
rescue ArgumentError => e
  warn "Invalid repository URL: #{e.message}"
  exit 1
rescue StandardError => e
  warn "Failed to pull repository: #{git_repository}"
  puts e.message
  exit 1
end