Class: Pantograph::Actions::GitSubmoduleUpdateAction

Inherits:
Pantograph::Action show all
Defined in:
pantograph/lib/pantograph/actions/git_submodule_update.rb

Constant Summary

Constants inherited from Pantograph::Action

Pantograph::Action::AVAILABLE_CATEGORIES, Pantograph::Action::RETURN_TYPES

Documentation collapse

Class Method Summary collapse

Methods inherited from Pantograph::Action

action_name, author, deprecated_notes, details, example_code, lane_context, method_missing, other_action, return_type, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorsObject



46
47
48
# File 'pantograph/lib/pantograph/actions/git_submodule_update.rb', line 46

def self.authors
  ['johnknapprs']
end

.available_optionsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'pantograph/lib/pantograph/actions/git_submodule_update.rb', line 22

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

.categoryObject



54
55
56
# File 'pantograph/lib/pantograph/actions/git_submodule_update.rb', line 54

def self.category
  :source_control
end

.descriptionObject



18
19
20
# File 'pantograph/lib/pantograph/actions/git_submodule_update.rb', line 18

def self.description
  'Execute git submodule command'
end

.is_supported?(platform) ⇒ Boolean

Returns:



50
51
52
# File 'pantograph/lib/pantograph/actions/git_submodule_update.rb', line 50

def self.is_supported?(platform)
  true
end

.outputObject



40
41
# File 'pantograph/lib/pantograph/actions/git_submodule_update.rb', line 40

def self.output
end

.return_valueObject



43
44
# File 'pantograph/lib/pantograph/actions/git_submodule_update.rb', line 43

def self.return_value
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'pantograph/lib/pantograph/actions/git_submodule_update.rb', line 4

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