Class: Fastlane::Actions::AddGitRemoteAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



54
55
56
# File 'lib/fastlane/plugin/menigit/actions/add_git_remote.rb', line 54

def self.authors
  ["Marcin Stepnowski"]
end

.available_optionsObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 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

.categoryObject



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

def self.category
  :source_control
end

.descriptionObject



13
14
15
# File 'lib/fastlane/plugin/menigit/actions/add_git_remote.rb', line 13

def self.description
  "This will add a remote repository"
end

.detailsObject



17
18
19
20
21
22
23
# 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_codeObject



40
41
42
43
44
# 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) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/fastlane/plugin/menigit/actions/add_git_remote.rb', line 50

def self.is_supported?(platform)
  true
end

.run(options) ⇒ Object



6
7
8
9
10
11
# 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