From 2c748c8b0319f8089385ad4f8e4d435092e37374 Mon Sep 17 00:00:00 2001 From: RomanDashchakivskyi-TomTom Date: Mon, 19 Dec 2022 19:06:21 +0200 Subject: [PATCH 1/2] Prevent exception on successful keys removal --- lib/pod/command/keys/rm.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pod/command/keys/rm.rb b/lib/pod/command/keys/rm.rb index 4e8f789..86a3ae0 100644 --- a/lib/pod/command/keys/rm.rb +++ b/lib/pod/command/keys/rm.rb @@ -55,7 +55,7 @@ def run matching_keys = matches(keyring.keys) if matching_keys.count > 0 messages = matching_keys.map { |e| delete_key(e, keyring) } - raise Informative, messages.join("\n") + UI.puts messages.join("\n") unless config.silent? else raise Informative, "Could not find key that matched \"#{@key_name}\"." end From 8742e94bc9c3289ecb606f9a02cf258d967a8fa4 Mon Sep 17 00:00:00 2001 From: RomanDashchakivskyi-TomTom Date: Mon, 19 Dec 2022 19:13:03 +0200 Subject: [PATCH 2/2] Prevent error when removing keys from project without keys --- lib/pod/command/keys/rm.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/pod/command/keys/rm.rb b/lib/pod/command/keys/rm.rb index 86a3ae0..041e47f 100644 --- a/lib/pod/command/keys/rm.rb +++ b/lib/pod/command/keys/rm.rb @@ -48,6 +48,11 @@ def run raise Informative, 'Could not find a project to remove the key from.' end + unless keyring.keys.count > 0 + UI.puts "Project does not have keys to remove." + return + end + if @wipe_all @key_name = '*' end