match/lib/match/nuke.rb in fastlane-2.183.2 vs match/lib/match/nuke.rb in fastlane-2.184.0

- old
+ new

@@ -100,13 +100,15 @@ params.option_for_key(:git_url).optional = true end end def spaceship_login - if api_token + if (api_token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key], filepath: params[:api_key_path])) UI.message("Creating authorization token for App Store Connect API") Spaceship::ConnectAPI.token = api_token + elsif !Spaceship::ConnectAPI.token.nil? + UI.message("Using existing authorization token for App Store Connect API") else Spaceship::ConnectAPI.login(params[:username], use_portal: true, use_tunes: false, portal_team_id: params[:team_id], team_name: params[:team_name]) end if Spaceship::ConnectAPI.client.in_house? && (type == "distribution" || type == "enterprise") @@ -116,15 +118,9 @@ UI.error("By nuking your account's enterprise, all your in-house apps will stop working!") if type == "enterprise" UI.error("---") UI.user_error!("Enterprise account nuke cancelled") unless UI.confirm("Do you really want to nuke your Enterprise account?") end - end - - def api_token - @api_token ||= Spaceship::ConnectAPI::Token.create(**params[:api_key]) if params[:api_key] - @api_token ||= Spaceship::ConnectAPI::Token.from_json_file(params[:api_key_path]) if params[:api_key_path] - return @api_token end # Collect all the certs/profiles def prepare_list UI.message("Fetching certificates and profiles...")