Class: Fastlane::Actions::GitPullAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/git_pull.rb

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

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

Class Method Details

.authorsObject



37
38
39
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 37

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

.available_optionsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 22

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :only_tags,
                                 description: "Simply pull the tags, and not bring new commits to the current branch from the remote",
                                 type: Boolean,
                                 optional: true,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :rebase,
                                 description: "Rebase on top of the remote branch instead of merge",
                                 type: Boolean,
                                 optional: true,
                                 default_value: false)
  ]
end

.categoryObject



53
54
55
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 53

def self.category
  :source_control
end

.descriptionObject



18
19
20
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 18

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

.example_codeObject



45
46
47
48
49
50
51
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 45

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

.is_supported?(platform) ⇒ Boolean

Returns:



41
42
43
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 41

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'fastlane/lib/fastlane/actions/git_pull.rb', line 4

def self.run(params)
  commands = []

  unless params[:only_tags]
    command = "git pull"
    command << " --rebase" if params[:rebase]
    commands += ["#{command} &&"]
  end

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

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