Sha256: 8e4d6467328fc64345270baee2e619603a906d724262fafc3add33b18c7928b6

Contents?: true

Size: 1.27 KB

Versions: 7

Compression:

Stored size: 1.27 KB

Contents

module Pantograph
  module Actions
    class GitSubmoduleUpdateAction < Action
      def self.run(params)
        cmd = []
        cmd << 'git submodule update'
        cmd << '--init'      if params[:init]
        cmd << '--recursive' if params[:recursive]
        cmd = cmd.join(' ')

        Actions.sh(cmd)
      end

      #####################################################
      # @!group Documentation
      #####################################################

      def self.description
        'Execute git submodule command'
      end

      def self.available_options
        [
          PantographCore::ConfigItem.new(
            key: :recursive,
            description: 'Add the `--recursive` flag',
            type: Boolean,
            default_value: false
          ),
          PantographCore::ConfigItem.new(
            key: :init,
            description: 'Add the `--init` flag',
            type: Boolean,
            is_string: false,
            default_value: false
          )
        ]
      end

      def self.output
      end

      def self.return_value
      end

      def self.authors
        ['johnknapprs']
      end

      def self.is_supported?(platform)
        true
      end

      def self.category
        :source_control
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pantograph-0.1.22 pantograph/lib/pantograph/actions/git_submodule_update.rb
pantograph-0.1.21 pantograph/lib/pantograph/actions/git_submodule_update.rb
pantograph-0.1.20 pantograph/lib/pantograph/actions/git_submodule_update.rb
pantograph-0.1.19 pantograph/lib/pantograph/actions/git_submodule_update.rb
pantograph-0.1.17 pantograph/lib/pantograph/actions/git_submodule_update.rb
pantograph-0.1.16 pantograph/lib/pantograph/actions/git_submodule_update.rb
pantograph-0.1.15 pantograph/lib/pantograph/actions/git_submodule_update.rb