b0VIM 8.0c\)'hjoshJoshs-MBP~josh/Projects/fastlane/fastlane/spaceship/lib/spaceship/portal/ui/select_team.rbutf-8 3210#"! UtpLN"Rad]LeCi8  p O $ Z * Z 7 %   s I = (    | p \ R   oV(p5cwOj^]n`z end return team['teamId'] if team['name'].strip == team_name teams.each_with_index do |team, i| # User provided a value, let's see if it's valid puts "team_n puts "team_name: #{tea end puts "Couldn't find team with ID '#{team_id}'. Make sure your are using the correct App Store Connect team ID and have the proper permissions for this team" # https://github.com/fastlane/fastlane/issues/14228 # "Access Unavailable - You currently don't have access to this membership resource. Contact your team's Account Holder, Josh Holtz, or an Admin." # This is especially important as Developer Portal team IDs are deprecated and should be replaced with App Store Connect teamIDs # Better message to inform user of misconfiguration as Apple now provides less friendly error as of 2019-02-12 end return team['teamId'] if team['currentTeamMember']['teamMemberId'].to_s.strip == team_id return team['teamId'] if team['teamId'].strip == team_id # There are 2 different values - one from the login page one from the Dev Team Page teams.each_with_index do |team, i| # User provided a value, let's see if it's valid if team_id.length > 0 team_name = (team_name || ENV['FASTLANE_TEAM_NAME'] || '').strip team_id = (team_id || ENV['FASTLANE_TEAM_ID'] || '').strip end raise "Your account is in no teams" puts("To learn more about teams and how to use them visit https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/ManagingYourTeam/ManagingYourTeam.html") puts("You must accept an invitation to a team for it to be available") puts("No teams available on the Developer Portal") if teams.count == 0 teams = client.teams def select_team(team_id: nil, team_name: nil) # rubocop:enable Require/MissingRequireStatement end return true end return FastlaneCore::UI.interactive? if Object.const_defined?("FastlaneCore") && FastlaneCore.const_defined?("UI") def self.interactive? end return false end return FastlaneCore::Helper.ci? if Object.const_defined?("FastlaneCore") && FastlaneCore.const_defined?("Helper") def self.ci? # rubocop:disable Require/MissingRequireStatement # ] # {...} # "name"=>"Company GmbH"}, # {"personId"=>nil, "firstName"=>nil, "lastName"=>nil, "email"=>nil, "developerStatus"=>nil, "privileges"=>{}, "roles"=>["TEAM_ADMIN"], "teamMemberId"=>"HQR8N4GAAA"}, # "currentTeamMember"=> # "name"=>"iOS Developer Program"}], # "availableDeviceSlots"=>100, # "platform"=>"ios", # "dateExpire"=>"11/20/15 07:59", # "dateStart"=>"11/20/14 07:59", # "inRenewalWindow"=>false, # "inDeviceResetWindow"=>false, # "status"=>"active", # "membershipProductId"=>"ds1", # [{"membershipId"=>"HJ5WHYC5CE", # "memberships"=> # "teamMemberId"=>"5Y354CXAAA"}, # "developerStatus"=>"active", # "email"=>"spaceship@krausefx.com", # "lastName"=>"Krause", # "firstName"=>"Felix", # "personId"=>15534241111, # "teamAgent"=>{ # "extendedTeamAttributes"=>{}, # "type"=>"Company/Organization", # "teamId"=>"5A997XAAAA", # [{"status"=>"active", # @example teams value: # Shows the UI to select a team class UserInterface class Clientmodule Spaceshipad; "c%QP) 5  - !  A  w > =  4 3 eend end end end end return team_to_use['teamId'] if team_to_use team_to_use = teams[seend end end end end end end end end end end return team_to_use['teamId'] if team_to_use team_to_use = teams[selected] if selected >= 0 selected = ($stdin.gets || '').strip.to_i - 1 end puts("#{i + 1}) #{team['teamId']} \"#{team['name']}\" (#{team['type']})") teams.each_with_index do |team, i| puts("Multiple teams found on the " + "Developer Portal".yellow + ", please enter the number of the team you want to use: ") # Multiple teams, user has to select loop do # User Selection end raise "Multiple Teams found; unable to choose, terminal not interactive!" end puts("#{i + 1}) #{team['teamId']} \"#{team['name']}\" (#{team['type']})") teams.each_with_index do |team, i| puts("Available Teams:") puts("Please check that you set FASTLANE_TEAM_ID or FASTLANE_TEAM_NAME to the right value.") puts("Multiple teams found on the Developer Portal, Your Terminal is running in non-interactive mode! Cannot continue from here.") unless self.class.interactive? return teams[0]['teamId'] if teams.count == 1 # user is just in one team end puts "Couldn't find team with Name '#{team_name}. Make sure you have the proper permissions for this team'" # https://github.com/fastlane/fastlane/issues/14228 # "Access Unavailable - You currently don't have access to this membership resource. Contact your team's Account Holder, Josh Holtz, or an Admin."adxx3% # Better message to inf # Better message to inform user of misconfiguration as Apple now provides less friendly error as of 2019-02-12 end return team['teamId'] if team['name'].strip == team_name teams.each_with_index do |team, i| # User provided a value, let's see if it's valid if team_name.length > 0