Skip to content

Commit 8522938

Browse files
committed
remove tester from a specific app when specified
1 parent 8c3486d commit 8522938

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

pilot/lib/pilot/tester_manager.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,21 @@ def remove_tester(options)
5656
tester ||= Spaceship::Tunes::Tester::Internal.find(config[:email])
5757

5858
if tester
59-
tester.delete!
60-
Helper.log.info "Successfully removed tester #{tester.email}".green
59+
app_filter = (config[:apple_id] || config[:app_identifier])
60+
if app_filter
61+
begin
62+
app = Spaceship::Application.find(app_filter)
63+
raise "Couldn't find app with '#{app_filter}'" unless app
64+
tester.remove_from_app!(app.apple_id)
65+
Helper.log.info "Successfully removed tester #{tester.email} from app #{app_filter}".green
66+
rescue => ex
67+
Helper.log.error "Could not remove #{tester.email} from app: #{ex}".red
68+
raise ex
69+
end
70+
else
71+
tester.delete!
72+
Helper.log.info "Successfully removed tester #{tester.email}".green
73+
end
6174
else
6275
Helper.log.error "Tester not found: #{config[:email]}".red
6376
end

0 commit comments

Comments
 (0)