lib/pilot/manager.rb in pilot-0.1.6 vs lib/pilot/manager.rb in pilot-0.1.7
- old
+ new
@@ -7,17 +7,14 @@
@config = options
login
end
def login
- user = config[:username]
- user ||= ENV["DELIVER_USERNAME"]
- user ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
- CredentialsManager::PasswordManager.shared_manager(user) if user
+ config[:username] ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
- Helper.log.info "Login to iTunes Connect"
- Spaceship::Tunes.login(user, CredentialsManager::PasswordManager.shared_manager(user).password)
+ Helper.log.info "Login to iTunes Connect (#{config[:username]})"
+ Spaceship::Tunes.login(config[:username])
Helper.log.info "Login successful"
end
# The app object we're currently using
def app
@@ -41,9 +38,10 @@
return @apple_id if @apple_id
config[:app_identifier] = fetch_app_identifier
if config[:app_identifier]
@app ||= Spaceship::Application.find(config[:app_identifier])
+ raise "Couldn't find app '#{config[:app_identifier]}' on the account of '#{config[:username]}'".red unless @app
app_id ||= @app.apple_id
end
app_id ||= ask("Could not automatically find the app ID, please enter it here (e.g. 956814360): ")
\ No newline at end of file