Sha256: 332581bc2c1d99ec209355cdd05ea9c8a500d5ddf5d30bcf4c9a775cbd8ae24e

Contents?: true

Size: 1.07 KB

Versions: 28

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

require "clamp"
#require "git"

module Makit
  module Cli
    # Define the 'pull' subcommand
    class PullCommand < Clamp::Command
      parameter "GIT_REPOSITORY", "The git repository url", attribute_name: :git_repository, required: true
      option "--ignore-errors", :flag, "Ignore errors and present warnings instead of exiting"

      def execute
        puts "pulling latest changes for repository: #{git_repository}"
        begin
          Makit::pull(git_repository)
        rescue Git::GitExecuteError => e
          $stderr.puts "failed to pull repository: #{git_repository}"
          puts "Please check the URL and your network connection."
          exit 1
        rescue => e
          $stderr.puts "failed to pull repository: #{git_repository}"
          puts e.message
          exit 1
        end
        clone_dir = Directories::get_clone_directory(git_repository)
        puts "size of clone directory: #{clone_dir} is #{Humanize::get_humanized_size(Directory::get_size(clone_dir))}"
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
makit-0.0.56 lib/makit/cli/pull.rb
makit-0.0.55 lib/makit/cli/pull.rb
makit-0.0.54 lib/makit/cli/pull.rb
makit-0.0.48 lib/makit/cli/pull.rb
makit-0.0.40 lib/makit/cli/pull.rb
makit-0.0.39 lib/makit/cli/pull.rb
makit-0.0.38 lib/makit/cli/pull.rb
makit-0.0.37 lib/makit/cli/pull.rb
makit-0.0.36 lib/makit/cli/pull.rb
makit-0.0.26 lib/makit/cli/pull.rb
makit-0.0.25 lib/makit/cli/pull.rb
makit-0.0.24 lib/makit/cli/pull.rb
makit-0.0.23 lib/makit/cli/pull.rb
makit-0.0.22 lib/makit/cli/pull.rb
makit-0.0.21 lib/makit/cli/pull.rb
makit-0.0.20 lib/makit/cli/pull.rb
makit-0.0.19 lib/makit/cli/pull.rb
makit-0.0.16 lib/makit/cli/pull.rb
makit-0.0.13 lib/makit/cli/pull.rb
makit-0.0.12 lib/makit/cli/pull.rb