class Fastlane::Actions::AddGitRemoteAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/menigit/actions/add_git_remote.rb, line 54
def self.authors
  ["Marcin Stepnowski"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/menigit/actions/add_git_remote.rb, line 25
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :remote,
                   env_name: "FL_ADD_GIT_REMOTE_REMOTE",
                   description: "Remote name",
                   optional: false,
                   type: String),
    FastlaneCore::ConfigItem.new(key: :path,
                   env_name: "FL_ADD_GIT_REMOTE_PATH",
                   description: "Path to repository. URL or SSH",
                   optional: false,
                   type: String)
  ]
end
category() click to toggle source
# File lib/fastlane/plugin/menigit/actions/add_git_remote.rb, line 46
def self.category
  :source_control
end
description() click to toggle source
# File lib/fastlane/plugin/menigit/actions/add_git_remote.rb, line 13
def self.description
  "This will add a remote repository"
end
details() click to toggle source
# File lib/fastlane/plugin/menigit/actions/add_git_remote.rb, line 17
def self.details
  [
    "This will automatically add a remote repository, where:",
    "- `remote` is the remote name",
    "- `path` is the remote path (URL or SSH)"
  ].join("\n")
end
example_code() click to toggle source
# File lib/fastlane/plugin/menigit/actions/add_git_remote.rb, line 40
def self.example_code
  [
    'add_git_remote(remote: "origin", path: "https://github.com/meniga/menigit")'
  ]
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/menigit/actions/add_git_remote.rb, line 50
def self.is_supported?(platform)
  true
end
run(options) click to toggle source
# File lib/fastlane/plugin/menigit/actions/add_git_remote.rb, line 6
def self.run(options)
  remote = options[:remote]
  path = options[:path]
  UI.message("Adding remote #{remote} #{path} 🎯.")
  Actions.sh("git remote add #{remote.shellescape} #{path.shellescape}")
end