lib/produce/developer_center.rb in produce-0.3.5 vs lib/produce/developer_center.rb in produce-0.4.0
- old
+ new
@@ -2,28 +2,27 @@
require 'babosa'
module Produce
class DeveloperCenter
- def run(config)
- @config = config
+ def run
login
create_new_app
end
def create_new_app
ENV["CREATED_NEW_APP_ID"] = Time.now.to_i.to_s
if app_exists?
- Helper.log.info "App '#{@config[:app_name]}' already exists, nothing to do on the Dev Center".green
+ Helper.log.info "App '#{Produce.config[:app_name]}' already exists, nothing to do on the Dev Center".green
ENV["CREATED_NEW_APP_ID"] = nil
# Nothing to do here
else
- app_name = valid_name_for(@config[:app_name])
+ app_name = valid_name_for(Produce.config[:app_name])
Helper.log.info "Creating new app '#{app_name}' on the Apple Dev Center".green
- app = Spaceship.app.create!(bundle_id: @config[:bundle_identifier].to_s,
+ app = Spaceship.app.create!(bundle_id: Produce.config[:bundle_identifier].to_s,
name: app_name)
Helper.log.info "Created app #{app.app_id}"
raise "Something went wrong when creating the new app - it's not listed in the apps list" unless app_exists?
@@ -41,19 +40,14 @@
latinazed.gsub(/[^0-9A-Za-z\d\s]/, '') # remove non-valid characters
end
private
def app_exists?
- Spaceship.app.find(@config[:bundle_identifier].to_s) != nil
+ Spaceship.app.find(Produce.config[:bundle_identifier].to_s) != nil
end
def login
- user = ENV["CERT_USERNAME"] || ENV["DELIVER_USER"] || CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
- manager = CredentialsManager::PasswordManager.shared_manager(user)
-
- ENV["FASTLANE_TEAM_NAME"] ||= ENV['PRODUCE_TEAM_NAME']
-
- Spaceship.login(user, manager.password)
+ Spaceship.login(Produce.config[:username], nil)
Spaceship.select_team
end
end
end