Sha256: fa31fb859b84a188fbeaef07ba00e937e3c84713f01aeec6a9359472eaf34fe1

Contents?: true

Size: 1.45 KB

Versions: 1

Compression:

Stored size: 1.45 KB

Contents

#!/usr/bin/env ruby

$:.push File.expand_path("../../lib", __FILE__)

require 'produce'
require 'commander'
require 'credentials_manager/password_manager'
require 'credentials_manager/appfile_config'

HighLine.track_eof = false

class ProduceApplication
  include Commander::Methods

  def run
    program :version, Produce::VERSION
    program :description, 'CLI for \'produce\''
    program :help, 'Author', 'Felix Krause <produce@krausefx.com>'
    program :help, 'Website', 'https://fastlane.tools'
    program :help, 'GitHub', 'https://github.com/krausefx/produce'
    program :help_formatter, :compact

    always_trace!

    global_option('-u', '--username STRING', 'Your Apple ID username')

    command :create do |c|
      c.syntax = 'produce create'
      c.description = 'Creates a new app on iTunes Connect and the Apple Developer Portal'

      c.action do |args, options|
        set_username(options.username)

        puts Produce::Manager.start_producing
      end
    end

    def set_username(username)
      user = username
      user ||= ENV["PRODUCE_USERNAME"]
      user ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)      
      CredentialsManager::PasswordManager.shared_manager(user) if user
    end

    default_command :create

    run!
  end
end

begin
  FastlaneCore::UpdateChecker.start_looking_for_update('produce')
  ProduceApplication.new.run
ensure
  FastlaneCore::UpdateChecker.show_update_status('produce', Produce::VERSION)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
produce-0.2.0 bin/produce