Class: Fastlane::Actions::SetGitConfigUserAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/menigit/actions/set_git_config_user.rb

Class Method Summary collapse

Class Method Details

.authorsObject



59
60
61
# File 'lib/fastlane/plugin/menigit/actions/set_git_config_user.rb', line 59

def self.authors
  ["Marcin Stepnowski"]
end

.available_optionsObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/fastlane/plugin/menigit/actions/set_git_config_user.rb', line 29

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :name,
                                   env_name: "FL_SET_GIT_CONFIG_USER_NAME",
                                   description: "User name",
                                   optional: false,
                                   type: String),

    FastlaneCore::ConfigItem.new(key: :email,
                                   env_name: "FL_SET_GIT_CONFIG_USER_EMAIL",
                                   description: "User email",
                                   optional: false,
                                   type: String)
  ]
end

.categoryObject



51
52
53
# File 'lib/fastlane/plugin/menigit/actions/set_git_config_user.rb', line 51

def self.category
  :source_control
end

.descriptionObject



17
18
19
# File 'lib/fastlane/plugin/menigit/actions/set_git_config_user.rb', line 17

def self.description
  "This will set git config user"
end

.detailsObject



21
22
23
24
25
26
27
# File 'lib/fastlane/plugin/menigit/actions/set_git_config_user.rb', line 21

def self.details
  [
    "This will automatically set git config user, where:",
    "- `email` is the user email",
    "- `name` is the user name"
  ].join("\n")
end

.example_codeObject



45
46
47
48
49
# File 'lib/fastlane/plugin/menigit/actions/set_git_config_user.rb', line 45

def self.example_code
  [
    'set_git_config_user(name: "MenigaBuildsson", email: "[email protected]")'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/fastlane/plugin/menigit/actions/set_git_config_user.rb', line 55

def self.is_supported?(platform)
  true
end

.run(options) ⇒ Object



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

def self.run(options)
  name = options[:name]
  email = options[:email]

  UI.message("Setting git config user.name to #{name} 🎯.")
  Actions.sh("git config user.name #{name.shellescape}")

  UI.message("Setting git config user.email to #{email} 🎯.")
  Actions.sh("git config user.email #{email.shellescape}")
end