Sha256: e473414865d1c6f2c8c9bfe8d944742f1ff6b34714238a64b0ad850b226c00ee

Contents?: true

Size: 1.38 KB

Versions: 4

Compression:

Stored size: 1.38 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 FastlaneApplication
  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', 'http://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)

        Produce::Config.shared_config # to ask for missing information right in the beginning
        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

FastlaneApplication.new.run

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
produce-0.1.3 bin/produce
produce-0.1.2 bin/produce
produce-0.1.1 bin/produce
produce-0.1.0 bin/produce