#!/usr/bin/env ruby $LOAD_PATH.push File.expand_path("../../lib", __FILE__) require "spaceship" require "pry" require "colored" require "credentials_manager" def docs url = 'https://github.com/fastlane/spaceship/tree/master/docs' `open '#{url}'` url end username = ARGV[1] if ARGV[0] == '-u' username ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id) username ||= ask("Username: ") begin puts "Logging into to iTunes Connect (#{username})..." Spaceship::Tunes.login(username) puts "Successfully logged in to iTunes Connect".green puts "" rescue puts "Could not login to iTunes Connect..." end begin puts "Logging into the Developer Portal (#{username})..." Spaceship::Portal.login(username) puts "Successfully logged in to the Developer Portal".green puts "" rescue puts "Could not login to the Developer Portal..." end puts "---------------------------------------".green puts "| Welcome to the spaceship playground |".green puts "---------------------------------------".green puts "" puts "Enter #{'docs'.yellow} to open up the documentation" puts "Enter #{'exit'.yellow} to exit the spaceship playground" puts "Enter #{'_'.yellow} to access the return value of the last executed command" puts "" puts "Just enter the commands and confirm with Enter".green # rubocop:disable Lint/Debugger binding.pry(quiet: true) # rubocop:enable Lint/Debugger puts "" # Fixes https://github.com/fastlane/spaceship/issues/203