Sha256: f608732b26d29e987521c4db3dfdcd651b4fdbc23ef3958e7dd62ec5055b36e6

Contents?: true

Size: 1.04 KB

Versions: 25

Compression:

Stored size: 1.04 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

25 entries across 25 versions & 1 rubygems

Version Path
makit-0.0.57 lib/makit/cli/pull.rb
makit-0.0.53 lib/makit/cli/pull.rb
makit-0.0.52 lib/makit/cli/pull.rb
makit-0.0.51 lib/makit/cli/pull.rb
makit-0.0.50 lib/makit/cli/pull.rb
makit-0.0.49 lib/makit/cli/pull.rb
makit-0.0.47 lib/makit/cli/pull.rb
makit-0.0.46 lib/makit/cli/pull.rb
makit-0.0.45 lib/makit/cli/pull.rb
makit-0.0.44 lib/makit/cli/pull.rb
makit-0.0.42 lib/makit/cli/pull.rb
makit-0.0.41 lib/makit/cli/pull.rb
makit-0.0.35 lib/makit/cli/pull.rb
makit-0.0.34 lib/makit/cli/pull.rb
makit-0.0.33 lib/makit/cli/pull.rb
makit-0.0.32 lib/makit/cli/pull.rb
makit-0.0.31 lib/makit/cli/pull.rb
makit-0.0.30 lib/makit/cli/pull.rb
makit-0.0.29 lib/makit/cli/pull.rb
makit-0.0.28 lib/makit/cli/pull.rb