Sha256: 0b07c94053fa01ef3662dae7471095055b800f5e00ef421cdd0d647cfc8e8609

Contents?: true

Size: 665 Bytes

Versions: 7

Compression:

Stored size: 665 Bytes

Contents

require_relative 'action'
require_relative '../helpers/system_commands'

module Arli
  module Actions
    class GitRepo < Action

      include ::Arli::Helpers::SystemCommands

      description 'Fetches or updates remote git repositories'
      check_command 'git --version'
      check_pattern 'git version'

      def execute
        run_system_command(git_clone_command)
        print_action_success('cloned', "cloned from #{library.url}")
      end

      def git_update_command
        "cd #{library.path} && git pull --rebase 2>&1"
      end

      def git_clone_command
        "git clone -v #{library.url} #{library.dir} 2>&1"
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
arli-1.4.0 lib/arli/actions/git_repo.rb
arli-1.3.0 lib/arli/actions/git_repo.rb
arli-1.2.1 lib/arli/actions/git_repo.rb
arli-1.1.0 lib/arli/actions/git_repo.rb
arli-1.0.2 lib/arli/actions/git_repo.rb
arli-1.0.1 lib/arli/actions/git_repo.rb
arli-1.0.0 lib/arli/actions/git_repo.rb