class Fastlane::Actions::SetGitConfigUserAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/menigit/actions/set_git_config_user.rb, line 59
def self.authors
  ["Marcin Stepnowski"]
end
available_options() click to toggle source
# 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
category() click to toggle source
# File lib/fastlane/plugin/menigit/actions/set_git_config_user.rb, line 51
def self.category
  :source_control
end
description() click to toggle source
# File lib/fastlane/plugin/menigit/actions/set_git_config_user.rb, line 17
def self.description
  "This will set git config user"
end
details() click to toggle source
# 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_code() click to toggle source
# File lib/fastlane/plugin/menigit/actions/set_git_config_user.rb, line 45
def self.example_code
  [
    'set_git_config_user(name: "MenigaBuildsson", email: "mobile.dev@meniga.com")'
  ]
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/menigit/actions/set_git_config_user.rb, line 55
def self.is_supported?(platform)
  true
end
run(options) click to toggle source
# 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