pilot/lib/pilot/tester_manager.rb in fastlane-2.28.3 vs pilot/lib/pilot/tester_manager.rb in fastlane-2.28.4
- old
+ new
@@ -63,12 +63,21 @@
app_filter = (config[:apple_id] || config[:app_identifier])
if app_filter
begin
app = Spaceship::Application.find(app_filter)
UI.user_error!("Couldn't find app with '#{app_filter}'") unless app
- groups = remove_tester_from_groups!(tester: tester, app: app, groups: config[:groups])
- group_names = groups.map(&:name).join(", ")
- UI.success("Successfully removed tester #{tester.email} from app #{app_filter} in group(s) #{group_names}")
+
+ # If no groups are passed to options, remove the tester from the app-level,
+ # otherwise remove the tester from the groups specified.
+ if config[:groups].nil?
+ test_flight_tester = Spaceship::TestFlight::Tester.find(app_id: app.apple_id, email: tester.email)
+ test_flight_tester.remove_from_app!(app_id: app.apple_id)
+ UI.success("Successfully removed tester, #{test_flight_tester.email}, from app: #{app_filter}")
+ else
+ groups = remove_tester_from_groups!(tester: tester, app: app, groups: config[:groups])
+ group_names = groups.map(&:name).join(", ")
+ UI.success("Successfully removed tester #{tester.email} from app #{app_filter} in group(s) #{group_names}")
+ end
rescue => ex
UI.error("Could not remove #{tester.email} from app: #{ex}")
raise ex
end
else