class Fastlane::Actions::InitAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/apprepo/actions/init.rb, line 42
def self.authors
  ['suculent@me.com']
end
available_options() click to toggle source
# File lib/fastlane/plugin/apprepo/actions/init.rb, line 38
def self.available_options
  []
end
description() click to toggle source

@!group Documentation

# File lib/fastlane/plugin/apprepo/actions/init.rb, line 34
def self.description
  'Initializes Repofile'
end
is_supported?(_platform) click to toggle source
# File lib/fastlane/plugin/apprepo/actions/init.rb, line 46
def self.is_supported?(_platform)
  true
end
run(_params) click to toggle source
# File lib/fastlane/plugin/apprepo/actions/init.rb, line 9
def self.run(_params)
  # sh 'bundle exec rubocop -D'
  command :init do |c|
    c.syntax = 'apprepo init'
    c.description = 'Create the initial `apprepo` configuration'
    c.action do |_args, options|
      if File.exist?('Repofile') || File.exist?('fastlane/Repofile')
        UI.important('You already got a running apprepo setup.')
        return 0
      end

      require 'apprepo/setup'
      config = FastlaneCore::Configuration
      available_opts = Apprepo::Options.available_options
      options = config.create(available_opts, options.__hash__)
      Apprepo::Runner.new(options)
      Apprepo::Setup.new.run(options)
    end
  end
end