Sha256: eaf89c8c20c1af268a0c098dffcdc5770759bb993408ea946a6a154b8670610b

Contents?: true

Size: 1.45 KB

Versions: 11

Compression:

Stored size: 1.45 KB

Contents

module Pantograph
  module Actions
    class GitPullAction < Action
      def self.run(params)
        commands = []

        unless params[:only_tags]
          commands += ["git pull &&"]
        end

        commands += ["git fetch --tags"]

        Actions.sh(commands.join(' '))
      end

      def self.description
        "Executes a simple git pull command"
      end

      def self.available_options
        [
          PantographCore::ConfigItem.new(key: :only_tags,
                                       description: "Simply pull the tags, and not bring new commits to the current branch from the remote",
                                       is_string: false,
                                       optional: true,
                                       default_value: false,
                                       verify_block: proc do |value|
                                         UI.user_error!("Please pass a valid value for only_tags. Use one of the following: true, false") unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
                                       end)
        ]
      end

      def self.authors
        ["KrauseFx", "JaviSoto"]
      end

      def self.is_supported?(platform)
        true
      end

      def self.example_code
        [
          'git_pull',
          'git_pull(only_tags: true) # only the tags, no commits'
        ]
      end

      def self.category
        :source_control
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pantograph-0.1.14 pantograph/lib/pantograph/actions/git_pull.rb
pantograph-0.1.13 pantograph/lib/pantograph/actions/git_pull.rb
pantograph-0.1.12 pantograph/lib/pantograph/actions/git_pull.rb
pantograph-0.1.10 pantograph/lib/pantograph/actions/git_pull.rb
pantograph-0.1.8 pantograph/lib/pantograph/actions/git_pull.rb
pantograph-0.1.7 pantograph/lib/pantograph/actions/git_pull.rb
pantograph-0.1.6 pantograph/lib/pantograph/actions/git_pull.rb
pantograph-0.1.4 pantograph/lib/pantograph/actions/git_pull.rb
pantograph-0.1.3 pantograph/lib/pantograph/actions/git_pull.rb
pantograph-0.1.1 pantograph/lib/pantograph/actions/git_pull.rb
pantograph-0.1.0 pantograph/lib/pantograph/actions/git_pull.rb