Class: Fastlane::Actions::HgPushAction

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

Overview

Pushes commits to the remote hg repo

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, details, method_missing, other_action, output, return_value, sh, step_text

Class Method Details

.authorObject



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

def self.author
  # credits to lmirosevic for original git version
  "sjrmanning"
end

.available_optionsObject



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

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :force,
                                 env_name: "FL_HG_PUSH_FORCE",
                                 description: "Force push to remote. Defaults to false",
                                 is_string: false,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :destination,
                                 env_name: "FL_HG_PUSH_DESTINATION",
                                 description: "The destination to push to",
                                 default_value: '',
                                 optional: true)
  ]
end

.descriptionObject



17
18
19
# File 'lib/fastlane/actions/hg_push.rb', line 17

def self.description
  "This will push changes to the remote hg repository"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



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

def self.run(params)
  command = ['hg', 'push']

  command << '--force' if params[:force]
  command << params[:destination] unless params[:destination].empty?

  return command.join(' ') if Helper.is_test?

  Actions.sh(command.join(' '))
  UI.success('Successfully pushed changes to remote 🚀.')
end