sigh/lib/sigh/runner.rb in fastlane-2.183.2 vs sigh/lib/sigh/runner.rb in fastlane-2.184.0
- old
+ new
@@ -15,13 +15,15 @@
def run
FastlaneCore::PrintTable.print_values(config: Sigh.config,
hide_keys: [:output_path],
title: "Summary for sigh #{Fastlane::VERSION}")
- if api_token
+ if (api_token = Spaceship::ConnectAPI::Token.from(hash: Sigh.config[:api_key], filepath: Sigh.config[: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
# Username is now optional since addition of App Store Connect API Key
# Force asking for username to prompt user if not already set
Sigh.config.fetch(:username, force_ask: true)
@@ -61,16 +63,10 @@
end
return download_profile(profile)
end
- def api_token
- @api_token ||= Spaceship::ConnectAPI::Token.create(**Sigh.config[:api_key]) if Sigh.config[:api_key]
- @api_token ||= Spaceship::ConnectAPI::Token.from_json_file(Sigh.config[:api_key_path]) if Sigh.config[:api_key_path]
- return @api_token
- end
-
# The kind of provisioning profile we're interested in
def profile_type
return @profile_type if @profile_type
case Sigh.config[:platform]
@@ -284,10 +280,10 @@
[Spaceship::ConnectAPI::Device::DeviceClass::APPLE_TV]
when 'macos', 'catalyst'
[Spaceship::ConnectAPI::Device::DeviceClass::MAC]
end
- if api_token
+ if Spaceship::ConnectAPI.token
return Spaceship::ConnectAPI::Device.all.select do |device|
device_classes.include?(device.device_class)
end
else
filter = { deviceClass: device_classes.join(",") }